Skip to main content
Question

Unable to re purchase subscription in sandbox environment of IOS.


Forum|alt.badge.img+5

I am testing purchases in sandbox. I have purchased a subscription before, and it has expired.

When I go in to purchase again, `Purchases.purchasePackage` prints purchase successful immediately  and returns nothing and stalls.

8 replies

Forum|alt.badge.img+5
  • Author
  • 1 reply
  • March 24, 2022

@tina do you see any reason why this is happening ?

 

 


jazmine
Forum|alt.badge.img+7
  • Dedicated Contributor
  • 122 replies
  • April 4, 2022

Hi @Programiz , 


Happy to help here! Is this issue still occurring?

If so can you please send over some debug logs? 

You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:
 

[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate


Please ensure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. The more information you include here, the better we'll be able to help.

 

Let me know if you have any questions!


I have the same issue. For my monthly package, Purchases.purchasePackage() does not open iOS purchase modal in sandbox and instantly returns. Works fine with Annually.

It’s the same piece of code with different products from getOfferings. 

If it failed instead of returning successfully, it would be great we could just handle the failure.


Forum|alt.badge.img

Maybe the reason is why is because after fifth renewal it is opt-out. it is handled by Apple connect.Here it is explained more broadly: https://stackoverflow.com/a/12027860


Forum|alt.badge.img+3
  • Member
  • 7 replies
  • September 1, 2022

This is still an ongoing issue for us, using RevenueCat SDK 4.0.0 in Unity 2021.3.8. After a few repurchases, it becomes impossible to repurchase that subscription product on iOS.

 

Those purchases are in sandbox. But it is impossible for us to determine if this is a sandbox-only issue. We never had a similar issue with in our current implementation of Unity IAP, so anwsering this is actually an important issue for us as we are currently trying to assess if the SDK is stable enough to launch with. 

 

PurchaseProduct conclude with no errors, but the CustomerInfo does not include any active Entitlement or any ActiveSubscription.

 

Here is a sample of the logs from one of those failed purchase:

2022-09-01 12:06:22.334218-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ Skipping products request because products were already cached. products: ["com.company.app.subscription_one_month_01"]
2022-09-01 12:06:22.337390-0400 AppName[18946:593336] [Purchases] - INFO: 💰 Purchasing Product 'com.company.app.subscription_one_month_01'
2022-09-01 12:06:22.340405-0400 AppName[18946:593336] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: com.company.app.subscription_one_month_01 XXXXXXXXXXXXXXX1 XXXXXXXXXXXXXXX2 1
2022-09-01 12:06:22.341816-0400 AppName[18946:593336] [Purchases] - DEBUG: ℹ️ Force refreshing the receipt to get latest transactions from Apple.

2022-09-01 12:06:23.055246-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/StoreKit/sandboxReceipt
2022-09-01 12:06:23.055986-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ Skipping products request because products were already cached. products: ["com.company.app.subscription_one_month_01"]
2022-09-01 12:06:23.056637-0400 AppName[18946:593336] [Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: XXXXXXXXXXXXXXXX
2022-09-01 12:06:23.088693-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Started
2022-09-01 12:06:23.089212-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST receipts
2022-09-01 12:06:23.097133-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts
2022-09-01 12:06:25.050778-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ API request completed: POST /v1/receipts 200
2022-09-01 12:06:25.066365-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Finished
2022-09-01 12:06:25.066750-0400 AppName[18946:594262] [Purchases] - DEBUG: ℹ️ Serial request done: POST receipts, 0 requests left in the queue
2022-09-01 12:06:25.071697-0400 AppName[18946:593336] [Purchases] - INFO: 😻💰 Purchased product - 'com.company.app.subscription_one_month_01'
2022-09-01 12:06:25.073391-0400 AppName[18946:593336] [Purchases] - INFO: 💰 Finishing transaction com.company.app.subscription_one_month_01 XXXXXXXXXXXXXXX1 (XXXXXXXXXXXXXXX2)

 


Andy
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 237 replies
  • September 14, 2022

We’ve had a few reports of this and it seems to be an issue with StoreKit 1. Upgrading to using an SDK version that allows you to use StoreKit 2 under the hood should help. 

The latest version of our iOS, Flutter, React-Native and Unity SDKs support StoreKit 2, by passing an extra parameter when configuring. 

 

Could you give it a shot? Let me know if you need instructions for any particular SDK. 


Forum|alt.badge.img+1

If only that worked...sigh.   Added StoreKit 2 if available.  Within sandbox, I am unable to re-purchase a cancelled subscription within the app after successfully purchasing it the first time.  However, I can go into iOS and re-subscribe under my sandbox account in Settings/App Store/sandbox account/manage/subscriptions.


Darren John McNally
Forum|alt.badge.img+3

Has anyone tried using a new sandboxed account on a device instead of relying on StoreKit just to help narrow down some of the issues encountered?

I know it’s not an ideal method for testing, but it could help narrow down some of the problems encountered. I’m using Unity > Xcode > RevenueCat, and I’ve found that new sandboxed accounts on devices work well for testing.

Let me know if this helps or if you’ve found other solutions!

On a side note: I also thought this was an interesting article that shows you how to control the subscription renewal rate for sandboxed testing.

The subscription renewal rate is the speed at which subscriptions renew for each tester in sandbox. The subscription renewal rate also determines the length of Billing Retry and Billing Grace Period for those testers.

You can change a tester’s subscription renewal rate at any time in their iOS Sandbox Account Settings or by following these steps in App Store Connect:

  1. From Users and Access, click Sandbox to view Sandbox accounts.

  2. Click the Sandbox account you want to modify.

  3. In the dialog that appears under Subscription Renewal Rate, select a renewal speed and click Save.

    By default, accounts are set to a speed equalization of 1 month = 5 minutes. You can slow down or speed up the renewal period using the options below. Subscriptions automatically renew up to 12 times before auto-renewal turns off on the thirteenth renewal attempt. Note that the speed of renewal in sandbox depends on the length of the subscription.
     

     


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