Question

Testing Agreement Interruption does not refresh purchaseinfo

  • 24 August 2021
  • 3 replies
  • 42 views

Badge

Hi there! I’m using an App Store sandbox user, auto-renewable subscriptions, and have enabled the “Interrupt Purchases for This Tester” option in App Store Connect.

When forcing the interruption, the `purchasePackage:` method fails with the correct error description.

I’ve set my delegate to call the method `didReceiveUpdatedPurchaserInfo:`. After the user agrees to the new terms, the App Store window closes and confirms the purchase but the delegate method `didReceiveUpdatedPurchaserInfo:` isn’t called. If I try to purchase the subscription again, I’m told I already own it.

I would expect the `didReceiveUpdatedPurchaserInfo:`delegate method to be called in this case. I’ve set up Apple Server-to-Server Notifications via the link provided by RevenueCat with no luck. Anyone know what might be going on?


3 replies

Userlevel 2
Badge +7

Hello @Michael!

I saw that this community post was opened up in our ticketing system. Pasting my response below:

I had the chance to test this with our iOS sample app to try to reproduce the same behavior you're seeing. I placed a print statement inside this code block to test if after agreeing to the new terms would hit this block.

After I agreed to the new terms, the purchase was successful. I tried subscribing again to confirm payment did go through and the print statement did indeed print, indicating that the delegate was called.

Can you double check your app if the delegate is part of the AppDelegate delegate? Documentation for reference: https://docs.revenuecat.com/docs/getting-started#optional-listening-for-purchaser-info-updates It would also be worth to try to reproduce in the sample app with a fresh sandbox account. The instructions to run the sample app are indicated in the directory's README file. You can change the sample app's configurations (bundle id, API keys, entitlement name) to match your app's settings.

 

Thank you for your reply @tina 

I have tested with interrupted condition (using appconnect sandbox setting).  Yes, this delegate/closure “didReceiveUpdated purchaserInfo” is called, but it is called after 5 minutes.  It’s conform RevenueCat documentation below https://docs.revenuecat.com/docs/purchaserinfo

This delegate/closure will be executed after one of the following action:  call getPurchaserInfo(), make a purchase, restore purchases.  I’ve tested this, and I can confirm what is written on the documentation.

Related with interruption testing from sandbox (accepting a new user agreement), the purchaseInfo delegate won’t automatically be called. We need to trigger actions such are written in the documentation (call getPurchaserInfo(), make a purchase, or restore purchases).  Unfortunately, when I called getPurchaserInfo() the cache will be updated if the cache is older than 5 minutes.

 

My questions are:

  1.  Is it possible that the PurchaserInfo cache to be updated automatically when there is update in device Payment queue by AppStore? https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_in-app_purchases_with_sandbox/testing_an_interrupted_purchase
  2. Is it possible to change the 5 minutes cache value programmatically/manually ? 
Badge

Hello @Michael!

Via Tina: Revenuecat support drafted a bug report for Apple on this topic.

Reply