Reputation: 1011
I have a new app that I want to release that unlocks features if users have purchased another app I previously released. Is there a way to check if a user purchased an app that isn't the current app, but by the same developer?
Upvotes: 3
Views: 886
Reputation: 318774
No, there is no 100% complete way to do this. Receipt verification only works for the current app. You can't access any purchase info about any other app, even if from the same developer.
One option is to see if the user has the other app installed by checking its custom URL scheme. Of course this requires that the user has the old app installed.
Upvotes: 1
Reputation: 13127
Update
OP has clarified that their goal is to go from a paid app to a freemium app, in which case a different solution becomes possible: see this Stack Overflow answer to see if it's helpful.
Original
It isn't possible to do exactly what you want, but you can get close.
Option 1: Have both apps send the result of UIDevice.currentDevice().identifierForVendor
to a server you control, then unify the two using a user account you create, e.g. an email address or password.
Option 2: Have both apps register a specific URL scheme that belongs to them. Either app can then query to see whether the other is installed, and can unlock functionality from there. To do this, use UIApplication.sharedApplication().canOpenURL(NSURL(string: "yourmagicurl://hello"))
Option 1 has the downside that it requires a server. Also, the vendor ID can and will change between device resets and when the last of your apps is removed. Option 2 has the downside that both apps must be installed simultaneously. So, neither solution is perfect, but I hope one of them comes close.
Upvotes: 1
Reputation: 54600
There are two ways I can think of to do this:
1) Create your own service that both apps can talk to and share information like, "this Game Center user bought this app." Then have the other app do a lookup.
2) Use the local keychain to store app specific data that your other apps can then read.
Upvotes: 2