IAPHelper icon indicating copy to clipboard operation
IAPHelper copied to clipboard

How to handle checks for cancelled subscriptions

Open PasqualePuzio opened this issue 7 years ago • 2 comments

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

PasqualePuzio avatar Apr 16 '17 13:04 PasqualePuzio