Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining and organizing purchases on multiple platforms

I have an application for various platforms. Let them be iOS, Android and Windows. In order to use a app, a monthly fee needs to be paid, but it just needs to be paid once in order to use all platforms. It is the same as with Spotify, so by paying once, every platform can be used.

According to the guidelines of Google and Apple, I need to offer In-App Purchases for the monthly fee. The system is connected to user accounts, which are managed by a server, which is in my control. I am storing the subscription data of users, so if a user uses the In-App Purchases on iOS, the information is transmitted to the central server in order to unlock the Android-App as well (in case it has been paid on another platform already)

The problem is the following scenario: A user has a valid subscription which has been payed via Google Play. The iOS and Windows apps are unlocked as well. Now the user uninstalls the Android app, goes to the Google Play website and cancels the subscription. In the current scenario, I am not able to detect this and the subscription will be valid for all other platforms.

The question is: Is there any pattern to circumvent this problem? Spotify and co are solving this issue as well, so there must be a solution for this

like image 753
thardes2 Avatar asked Nov 07 '22 21:11

thardes2


1 Answers

Well, the server that handles the authorization of the user (that is, your server) should query the Google Subscription API, to check if the current subscription is still valid. Each SubscriptionPurchase Resource contains information about when the subscription expires.

(see https://developers.google.com/android-publisher/api-ref/purchases/subscriptions)

For Apple, the same stuff applies: You will get a receipt, and with that receipt, you can query the server at any time to check if that subscription is still valid.

There is a slide which summarizes these points and the pitfalls very well: https://speakerdeck.com/rosapolis/the-recurring-nightmare-cross-platform-in-app-subscription-purchases

Bottom line: You won't be able to make that happen without a server that does the communication between the two stores. It comes with issues, though, as the slide shows.

Bonus: The talk from which the slides are taken is also on Youtube

like image 62
Daniel Gilbert Avatar answered Nov 27 '22 07:11

Daniel Gilbert