Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if user purchased a different app from same developer

Tags:

ios

receipt

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?

like image 702
user1218464 Avatar asked May 25 '26 08:05

user1218464


2 Answers

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.

like image 78
i_am_jorf Avatar answered May 26 '26 22:05

i_am_jorf


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.

like image 27
TwoStraws Avatar answered May 26 '26 22:05

TwoStraws



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!