shle2821
shle2821

Reputation: 1886

Does iOS In-App-Purchase cancellation reflect on NSBundle.mainBundle().appStoreReceiptURL

Let's say an iOS user purchases an auto renewal subscription. I am aware that NSBundle.mainBundle().appStoreReceiptURL shows some kind of digital receipt I can use to verify the purchase and the continuation of the subscription.

Then after some point the user cancels the subscription.

Questions:

When user cancels the subscription,

  1. Does NSBundle.mainBundle().appStoreReceiptURL reflect that cancellation right away?

I'm skeptical in this regard because NSBundle.mainBundle() is used to pull up what's stored locally in the app. If the user cancels the subscription by going to the OS' settings, and that will send some type of notification to Apple Server, then Apple Server should notify the app somehow.

  1. If somehow NSBundle.mainBundle().appStoreReceiptURL reflects the cancellation right away. How does Apple do it? Or is it up to me to implement a protocol to get the cancellation info?

  2. If, in fact, I do need to run a protocol, do other apps run it every time the app is launched?

Upvotes: 2

Views: 256

Answers (1)

Paulw11
Paulw11

Reputation: 115051

The user doesn't cancel the subscription as such. They turn off the renewal, so the subscription will not renew at the completion of the current period. If the auto renewal was still enabled then a new in-app purchase would be added to the receipt for the next period, but this will now not occur, so your app should determine that there isn't a currently active subscription and remove access to the content/features as appropriate.

Apple can cancel a subscription at the request of the user. In this case the cancellation_date field of the in-app purchase receipt item will have a value and your app should treat it as if the purchase was never made.

Your app should periodically (and at least at every launch) refresh the application receipt and verify the currently active subscriptions.

Upvotes: 2

Related Questions