Kuldeep Parmar
Kuldeep Parmar

Reputation: 45

Purchase Token data is same after i cancelled the subscription in Flutter

Hi i am new to flutter and i have integrated Auto Renewal subscription in flutter using this dependency. https://pub.dev/packages/flutter_inapp_purchase

I have done sandbox Yearly auto renewal subscription so it will auto renew at every 30 minutes a maximum of six times in sandbox and this works fine.

Issue i am facing Subscribed [email protected] at 1:00 PM so it will renews at every 30 minutes and i logout [email protected] from my app and i logged in with [email protected] and try to Subscribe/Restore i am getting the valid purchased token which actually associated with [email protected]

Does the scenario will be same in Production mode or will it give error in production mode?

If production mode scenario is same as sandbox then how can i manage it?

Thanks in advance

Upvotes: 2

Views: 491

Answers (1)

jeremynac
jeremynac

Reputation: 1242

On the package page, they say that you should disconnect the billing service once you're done with it, or it will keep running in the background.

I'm not sure exactly how the plugin works, but it's likely that even if you logout, the billing service keeps running with the previous user's session.

So, what you should do is call await FlutterInappPurchase.instance.endConnection; whenever you logout, and call await FlutterInappPurchase.instance.initConnection; again with the new user.

The part of the package docs where they talk about this: enter image description here

Upvotes: 1

Related Questions