IAPHelper
IAPHelper copied to clipboard
How to handle checks for cancelled subscriptions
Hi,
First of all, let me thank you for the great work. I'm a very happy adopter of your library since almost 2 years now ;)
I would like to implement a simple mechanism to properly handle cancelled subscriptions. In other words, if a user disables the auto-renewal of the subscription, I would like to be aware of it and thus deactivate the corresponding in-app purchase(s) when the subscription expires.
What's the best way do it? Will this be enough? Will this automatically clear subscriptions that are no longer active?
[[IAPShare sharedHelper].iap restoreProductsWithCompletion:^(SKPaymentQueue *payment, NSError *error) { if (error) { // error: do your stuff } else { // do your stuff } }];
Or should I clear in-app purchases before doing that?
[[IAPShare sharedHelper].iap clearSavedPurchasedProducts];
Thanks