My app has a single subscription group referred to as Premium
that accommodates two merchandise with completely different billing intervals – month-to-month
and yearly
. All checks are made in Apples’s Sandbox
atmosphere with sandbox person.
I’m presently testing a situation, the place the person is subscribed to the month-to-month
product, subsequently cancels the subscription from the App Retailer subscriptions web page, and earlier than the subscription expires, he desires to re-enable it (similar month-to-month
product). If the subscription is re-enabled from the App Retailer subscriptions web page, my server will get a notification concerning the modified subscription renewal standing and every part works properly. This situation is documented on the backside of the web page right here: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox/testing_disabling_auto-renew#3780478
I nonetheless additionally wish to help the situation the place the person can re-enable the subscription earlier than it expires from the app itself. To take action, if the subscription is cancelled, however not but expired, I present the person a button Re-activate
. When this button is clicked, I provoke a purchase order of the identical month-to-month
product, the IAP appropriately exhibits the fee sheet and as soon as I click on Subscribe
within the In App Buy fee sheet, it goes by way of with none points. Nonetheless, my app subsequently receives a callback that the acquisition failed:
<SKPaymentQueue: 0x280f1fa10>: Cost accomplished with error: Error Area=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x2803a4720 {Error Area=AMSErrorDomain Code=301 "Invalid Standing Code" UserInfo={NSLocalizedDescription=Invalid Standing Code, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?REDACTED, AMSStatusCode=500, NSLocalizedFailureReason=The response has an invalid standing code}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}
This looks like the acquisition failed with invalid standing, however surprisingly sufficient, my server receives a notification that the subscription renewal standing was modified to AUTO_RENEW_ENABLED
and if I verify the App Retailer subscriptions, I can see that its not referred to as anymore. The subscription additionally will get renewed on the finish of the billing interval, the place it could have in any other case been cancelled. So in different phrases, every part appears to work besides the acquisition error above.
My query is, what could possibly be the rationale for this? Maybe Apple doesn’t help re-enabling subscription instantly from the App, however solely from the App Retailer subscription web page? Or maybe its only a limitation of Apple’s sandbox atmosphere and I’d not obtain this fee error in manufacturing atmosphere?