3

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?

user1218464
  • 1,011
  • 2
  • 12
  • 22
  • I'm re-reading your question and wondering whether there's a chance you might fall foul of Apple's app review guidelines. Specifically, 11.1: "Apps that unlock or enable additional features or functionality with mechanisms other than the App Store will be rejected." Now, you're using the App Store for both apps, and you're doing something beneficial to end users, so *in theory* Apple might be OK with it. Worth taking into account, though. – TwoStraws Dec 15 '15 at 19:27
  • Yeah, this is more that I have 2 paid apps (iPhone and iPad) that I'd like to deprecate and make a free universal version of with IAP. I don't want to double charge users and would like to unlock the IAP if they already purchased the paid version. – user1218464 Dec 15 '15 at 19:35
  • Ah! That opens up another possibility; see my update. – TwoStraws Dec 15 '15 at 19:43
  • Note: It's not just going free to paid on the same app. It's that right now there's 2 apps (1 iPhone and 1 iPad) that I want to turn into 1 app that's universal. So I could make the iPhone version free (and check receipt validation), but then there's no way to know if the iPad version was purchased (to validate for those users). – user1218464 Dec 15 '15 at 19:46

3 Answers3

2

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.

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222
1

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.

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
rmaddy
  • 314,917
  • 42
  • 532
  • 579
1

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.

Community
  • 1
  • 1
TwoStraws
  • 12,862
  • 3
  • 57
  • 71
  • Thanks, I feared this might be the case. The first one also has the downside of having to release an update to both apps that communicate to the server (and have people update). So option two might have to do. – user1218464 Dec 15 '15 at 19:42
  • Note: It's not just going free to paid on the same app. It's that right now there's 2 apps (1 iPhone and 1 iPad) that I want to turn into 1 app that's universal. So I could make the iPhone version free (and check receipt validation), but then there's no way to know if the iPad version was purchased (to validate for those users). – user1218464 Dec 15 '15 at 19:45
  • Well, you certainly have a complicated use case :) – TwoStraws Dec 15 '15 at 19:46
  • Yeah, unfortunate case of not creating a universal app in the first place. ;) – user1218464 Dec 15 '15 at 19:51