3

From this tutorial! I came to know that we can fetch the status of auto renewable subscriptions through appStoreReceiptURL.

I want to know whether the appStoreReceiptURL is automatically refreshed and when it will occur during the renewal of auto renewable subscription.

Is there any tutorials available for this in Objective C?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Arun Basil Issac
  • 275
  • 2
  • 10

1 Answers1

5

I made a class for exactly this purpose. It checks the validity of the current subscription and returns a bool value whether you want to show content or not, and also saves the current subscription info.

Please take a look and tell me if it helped. Here is the class.

Edit

Yes, the user has to give the password every time the user purchases a subscription. Or else if the user deletes the app, then again installs the application. The class will know that a purchase has been made prior or not, ONLY if iTunes is logged in.

  1. To know purchases items iTunes has to be logged in from settings, hence uninstalling an app is not a problem.
  2. To purchase a product, subscription, the password is needed to enter every time by the user

I have created this application using this class, so I can tell you, it follows the IN APP purchase guidelines by Apple. I will upload an example project in Github, soon.

Community
  • 1
  • 1
Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
  • Can you explain a bit more on how the logic works? I believe this will not work anymore once a user deleted the app or has a new device, right?? – Jan Apr 12 '16 at 23:41
  • No this would still work. Provided the user is still logged in "in the Apple account from settings, which one was used for purchasing / subscribing before the app was deleted." – Saheb Roy Apr 13 '16 at 05:40
  • Doesn't the user have to login into itunes every time the class tries to check the subscription? Do you have a example app with the class to see the purchase process and checkup? Thanks! – Jan Apr 13 '16 at 07:14
  • Edited the answer please see. – Saheb Roy Apr 13 '16 at 07:17
  • Thank you for your answer, but I was more talking about the checkup if the user still has paid. Does the user need to repeatedly login to check if the subscription still has passed? – Jan Apr 13 '16 at 07:32
  • No. If user is already logged in iTunes, in settings. It will give you details of whether you have subscribed or not. To purchase a subscription, user has to give password again,irrespective of already logged in in settings – Saheb Roy Apr 13 '16 at 07:34
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/109010/discussion-between-jan-and-saheb-roy). – Jan Apr 13 '16 at 07:43
  • Apple [discourages](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1) calling to `validateRequest` from client: "Important: Do not call the App Store server /verifyReceipt endpoint from your app." – kelin Mar 29 '19 at 08:11