Flutter in_app_purchase multiple subscriptions

27 views Asked by At

I have an iOS app in Flutter and users can pay for a subscription. When they pay via Apple subscriptions the subscription I call InAppPurchase.instance.completePurchase(purchaseDetails) and register the user as having the paid plan on my server. Apple also registers the Apple account as having an active subscriptions, which renews etc. I save the payment token returned by apple on my server periodically to make sure they still have access to the paid plan.

This way, the use can log in with their email address to the web version or the android version and still use the paid plan, which is what I want.

However, the problem is that if the user logs out of their account on the phone that they used to buy the subscription with, Apple still considers it an active subscription and

  1. does not allow the user to buy another subscription for the new account

  2. sends the payment token from a restored purchase event on new login on device with an active subscription and my server can apply paid accounts ad infinitum with one paid login

I can live with (1) but would like to find a way to prevent (2) from happening.

To summarise, I want to scope Apple in-app subscriptions to specific user accounts, and allow multiple subscriptions to be purchased from the same Apple account.

0

There are 0 answers