Hi everyone,
I'm encountering an issue with StoreKit 2 and subscriptions that I hope someone can help clarify.
Here's the scenario:
- A user purchases a subscription.
- The user cancels the subscription in their Apple ID settings (it remains active until the end of the billing period).
- While the subscription is still active, the user reopens the app and tries to repurchase the same subscription.
The problem:
- The purchase() method start well a new billing flow, but once confirmed throws a StoreKitError.unknown.
- Despite this error, the subscription gets re-enabled and appears active again in the currentEntitlements.
So my question is why the purchase method throw an error and how to deal with this case ?
I precise I'm currently only working in sandbox, maybe the behavior is different in production (but even in that case there is still a bug in Sandbox that should not happen). Also in that case the Apple Server Notification API send the webhook with type DID_CHANGE_RENEWAL_STATUS (and subtype AUTO_RENEW_ENABLED), which is expected.
Thanks for help, Gregoire.