The following is the console log after running a Purchase!
>Purchases] - DEBUG: makePurchase
bPurchases] - DEBUG: Purchasing product from package - 20_Annual in Offering Default
uPurchases] - DEBUG: PaymentQueue updatedTransaction: 20_Annual 1000000905494521 ((null)) 1000000900724181 - 1
8.8.0 - bFirebase/Analytics]sI-ACS023141] Purchase is a duplicate and will not be reported. Product ID: 20_Annual
_Purchases] - DEBUG: Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/394FDF88-2AA3-4C58-A311-3F9B84500545/StoreKit/sandboxReceipt
dPurchases] - DEBUG: Found 0 unsynced attributes for App User ID: tu7gcKSaiUN7GmjYdbOSa94pPKs2
mPurchases] - DEBUG: There are no requests currently running, starting request POST /receipts
uPurchases] - DEBUG: API request started: POST /v1/receipts
rPurchases] - DEBUG: API request completed with status: POST /v1/receipts 200
aPurchases] - DEBUG: Serial request done: POST /receipts, 0 requests left in the queue
sPurchases] - DEBUG: Finishing transaction 20_Annual 1000000905494521 (1000000900724181)// My debug statement below
flutter: Purchase Level : 0 // This should be either 1 / 2 or 3
The following code makes the purchase:
PurchaserInfo purchaserInfo =await Purchases.purchasePackage( myProductList.index]);purchaserInfo.activeSubscriptions.forEach((element) {print('** $element **');}); // Nothing gets printed hereProvider.of<CP>(context,listen: false).subsLevel = 0;if (purchaserInfo.entitlements.alle'10 People'] != null && purchaserInfo.entitlements.alla'10 People']!.isActive == true) Provider.of<CP>(context,listen: false).subsLevel = 1;if (purchaserInfo.entitlements.alle'20 People'] != null && purchaserInfo.entitlements.alla'20 People']!.isActive == true) Provider.of<CP>(context,listen: false).subsLevel = 2;if (purchaserInfo.entitlements.alle'50 People'] != null && purchaserInfo.entitlements.alla'50 People']!.isActive == true) Provider.of<CP>(context,listen: false).subsLevel = 3;Navigator.pop(context, Provider.of<CP>(context,listen: false).subsLevel);
What am I doing wrong please?