Skip to main content
Solved

iOS Subscription not going through despite successful Purchase! Why?

  • November 8, 2021
  • 1 reply
  • 474 views

Forum|alt.badge.img+6
  • Helper
  • 7 replies

The following is the console log after running a Purchase!

 

[Purchases] - DEBUG: ℹī¸ makePurchase
[Purchases] - DEBUG: 💰 Purchasing product from package  - 20_Annual in Offering Default
[Purchases] - DEBUG: ℹī¸ PaymentQueue updatedTransaction: 20_Annual 1000000905494521 ((null)) 1000000900724181 - 1
8.8.0 - [Firebase/Analytics][I-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
[Purchases] - DEBUG: ℹī¸ Found 0 unsynced attributes for App User ID: tu7gcKSaiUN7GmjYdbOSa94pPKs2
[Purchases] - DEBUG: ℹī¸ There are no requests currently running, starting request POST /receipts
[Purchases] - DEBUG: ℹī¸ API request started: POST /v1/receipts
[Purchases] - DEBUG: ℹī¸ API request completed with status: POST /v1/receipts 200
[Purchases] - DEBUG: ℹī¸ Serial request done: POST /receipts, 0 requests left in the queue
[Purchases] - 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.all['10 People'] != null &&    purchaserInfo.entitlements.all['10 People']!.isActive == true)  Provider.of<CP>(context,listen: false).subsLevel = 1;if (purchaserInfo.entitlements.all['20 People'] != null &&    purchaserInfo.entitlements.all['20 People']!.isActive == true)  Provider.of<CP>(context,listen: false).subsLevel = 2;if (purchaserInfo.entitlements.all['50 People'] != null &&    purchaserInfo.entitlements.all['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?

Best answer by DEE

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.

View original
Did this post help you find an answer to your question?

1 reply

Forum|alt.badge.img+6
  • Author
  • Helper
  • 7 replies
  • Answer
  • November 9, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings