Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. PlatformException (PlatformException(storekit_no_receipt, Cannot find receipt for the current main bundle., null))
  2.  
  3. Future<void> _getPastPurchases() async {
  4. try {
  5. //final QueryPurchaseDetailsResponse response = await _iap.queryPastPurchases();
  6. final QueryPurchaseDetailsResponse response = await InAppPurchaseConnection.instance.queryPastPurchases();
  7. if (response.error != null) {
  8. // Handle the error
  9. print(response.error.toString());
  10. }
  11. print('response = ' + response.toString());
  12.  
  13. for (PurchaseDetails purchase in response.pastPurchases) {
  14. if (Platform.isIOS) {
  15. //InAppPurchaseConnection.instance.completePurchase(purchase);
  16. }
  17. }
  18.  
  19. setState(() {
  20. _purchases = response.pastPurchases;
  21. });
  22. } on PlatformException catch(err) {
  23. print(err.toString());
  24. }
  25. catch (err) {
  26. print(err.toString());
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement