When I purchase a previously purchased "Auto-Renewable Subscriptions" in my app, it said
You're currently subscribed to this...
When I clicked the OK, in the delegate of the payment queue..
- (void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction * transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchased:
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[self failedTransaction:transaction]; // Why this is called?
break;
case SKPaymentTransactionStateRestored:
[self restoreTransaction:transaction];
default:
break;
}
}
}
The transaction.transactionState returned is SKPaymentTransactionStateFailed instead of SKPaymentTransactionStateRestored, is it normal?
So how do I handle this correctly?
Make sure the device is logged in with the Google Play Store Account that made the original purchase. - Tap on the Menu, accounts, then Subscriptions. Make sure the device is logged in with the Google Play Store Account that made the original purchase. Tap on the ''Restore Purchases'' button.
Auto-renewable subscriptions provide access to content, services, or premium features in your app on an ongoing basis. They automatically renew at the end of their duration until the user chooses to cancel.
The subscription renewal process begins in the 10 days before the expiration date. During those 10 days, the App Store checks for any billing issues that might delay or prevent the subscription from being automatically renewed, for example, whether: The customer's payment method is active.
I have the same issue and I don't think there's any way to distinguish this event from other errors (it returns error code SKErrorPaymentCancelled
). I think the only way you can handle it is by having a "Restore Purchases" button, and call [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
when the user presses it.
Actually, you can't determine if the user is already subscribed. You should have Subscribe button that new users use to subscribe, and Restore button for already subscribed users.
And when you get SKPaymentTransactionStateFailed
you can show a message that suggests to use Restore button in case the user is already subscribed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With