Skip to main content
Solved

iOS Subscription not going through despite successful Purchase! Why?

  • 8 November 2021
  • 1 reply
  • 389 views

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?

1 reply

Badge +6

Found the answer, I did not have that test account in Sandbox environment in App Store connect. Once I created the account with the correct email, it worked.

Reply