Created
July 20, 2019 07:59
-
-
Save awaik/7806273546b6a901d8691b355a927fac to your computer and use it in GitHub Desktop.
check ios subscribtion fluter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Platform.isIOS) { | |
var history = await FlutterInappPurchase.getPurchaseHistory(); | |
for (var purchase in history) { | |
Duration difference = | |
DateTime.now().difference(purchase.transactionDate); | |
if (difference.inMinutes <= (duration + grace).inMinutes && | |
purchase.productId == 'SKU_OF_SUBSCRIPTION') return 'PAID_STATE_FOR_YOUR_CHOICE'; | |
} | |
return 'NOT_PAID_STATE_FOR_YOUR_CHOICE'; | |
} |
Hi, sorry, I don't remember :)
I switched to this package and service more then a year ago
https://pub.dev/packages/purchases_flutter
Posted it here
https://stackoverflow.com/questions/53880390/how-to-implement-in-app-purchases-subscription-in-flutter/55835182
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI, what is "duration + grace"? where should I get this info from