Restore purchases in auto renewable app - ios

In my Cocoa app, there is only auto-renewing subscription.
I check all the purchases when app starts and load the data only for purchased items.
I am also checking if there is any change(especially discontinuing the subscription) in the purchases every hour.(i.e I am not serializing user subscription in NSUserDefaults for security. They are always loaded from server when app starts)
Is it still necessary to put a Restore Purchases button in app ?
IMHO Restore button does not make any sense in app where you have only auto-renewing subscription.
Also is there any notification from apple when auto-renewable subscription ends ? Or what is the right way to check if the auto-renewing subscription has ended. Presently I am polling every hour for latest valid subscriptions.

You must need to provide a Restore Purchases option or functionality unless it will be reject by apple reviewer.
If you delete the app and again try to install this app then how to validate this user already having valid subscription.
Please check below what apple document says -
https://developer.apple.com/in-app-purchase/In-App-Purchase-Guidelines.pdf

Related

iOS Auto Renewable Subscriptions and Receipt Validation Clarifications

I was wondering if my approach regarding auto-renewable subscriptions is correct.
I have implemented an auto-renewable subscription in my app, it is the only IAP.
When the user launches the app, it performs receipt validation through Apple's servers. When I receive the response I check the expires_date_ms in latest_receipt_info to see if the user is subscribed or not. When I perform receipt validation I also add the exclude-old-transactions tag. I have also added a "Restore previous purchases" function to restore older receipts on the first app launch.
Is my approach correct or I am missing something? Also, do auto-renewable subscriptions auto-renew automatically or do I have to implement the feature by myself?
Thanks in advance for any help.
Regards.
Auto-renewable in-app subscriptions do renew automatically, you don't need to do anything for that. You just need to check if a subscriber has an active subscription when using your app. You can also activate the grace period in App Store Connect for your subscription, so your users will have access for additional 16 days if Apple could not renew the subscription. You can read more here https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/reducing_involuntary_subscriber_churn

Non-renewing sbuscription in iOS

I want to implement InApp purchase in my iOS video streaming app to do that I need to implement Non-renewing subscription e.g 1 month,3 months, 6 months and 1 year.
I am using Objetive-C in my application.
Can you please tell me how to implement it because as per Apple, developer need to manage subscription expiration date and time.
How to validate receipt ??
How to manage user's subscription on multiple device or restore user's subscription if user login on other device ??
Please help me and let me know if anything is required in Non-renewing subscription.
Thanks,
You should go through the in-app purchase programming guide before starting the implementation.
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction.html
Store-kit won't send you any notification in case of subscription end for a non-renewable subscription. You need to calculate the duration on your own and revoke the user's access to your server after that duration.
To verify the receipt you can do the validation on user's device or on your server, but your server is preferably better and even recommended by apple also.
For restoring the purchase you can go through the following doc
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9
Non Renewing subscription
First of non renewing subscription is the consumable keys that means once it purchased it just purchased. Keep in mind Storekit doesnot restore consumable products so you have to manage yourself because StoreKit does not do it as it do in Auto-renewable subscriptions and Non-consumable .
More details about Non renewing subscription :
Does Non-Renewing subscription requires a restore button?
How to manage?
To manage your in-app purchase you have to use server DB. You have to store your all purchases in server DB by using post API.
Benefits:
You can easily maintain the end date of purchase.
You can get each paid account every time user logged in with any device.
Note: Maintain your DB according to your need.

Will sandbox Auto-renewable subscription survive app reinstallation

Currently I testing Auto-renewable subscription in my app. Once I reinstalled app I cannot get my subscription back.
My question:
Will sandbox Auto-renewable subscription survive app reinstallation?
Yes, they do survive an app reinstallation. The user might need to trigger "Restore purchases" (which you really should provide in your app), but in my testing that usually wasn't necessary as after a reinstall all in-app purchases are already present in the App Store receipt.
Your code must be able to parse the App Store receipt to detect that subscription (and read its expiry date), of course.

Does Non-Renewing subscription requires a restore button?

My app got rejected because of restore button on non-renewing in app purchase. Do i have to remove restore button ? If i have to do so then how user will restore his purchases.Please help.
Non-renewing subscriptions are consumable. Therefore they cannot be restored. A restore button therefore makes no sense. You also need some kind of authentication/login system for the user. (See below for detailed explanations.)
Sources:
consumable vs. non-consumable in app purchases
non-renewing subscriptions
Update from WWDC2017: In Session #303 App Store Engineer Pete Hare explains at 3:00 that a non-renewing-subscription can be seen as "a consumable product with an expiry date on it"
There has been some debates in the comments wether non-renewing subscriptions are consumable or not, so I want to say something about it. "Consumable" means that you can consume them multiple times. Like "30 minutes of talking" in a voice-over-IP telephony application. On the other hand, there are non-consumables that you can buy only once. Like when you unlock all levels in a game app. You buy it once, and when you reset the device and redownload the app, you should be able to restore the purchase, so that you don't have to pay twice to unlock all levels. Furthermore, if you don't tap the restore-button in this case but just buy the "unlock all levels" package again, it works, but you will not be charged by apple a second time. That's why it is called non-consumable. It's some kind of metapher. An apple is "consumable". Once it is consumed, it is gone. A chair is non-consumable. You have it as long as you don't destroy it or give it away.
So, it makes sense to regard a non-renewing subscription as non-consumable. If you buy it a second time, you shouldn't pay twice, you should just use the old subscription you already have. If you reset the device, you should be able to restore the subscription once you re-download the app. The restoration is just not done by Apple but by the app itself.
I still regard non-renewing subscriptions as consumable though. I use a simple definition of consumable vs. non-consumable: An in-app-purchase is consumable, when, from the point of view of the StoreKit API, it can be purchased multiple times in the same week by the same user. All consumable IAP-items cannot be restored through the StoreKit. All non-consumable IAP-items can be restored through the StoreKit.
So, the developer is himself responsible for restoring the in-app-purchase of a non-renewing subscription, right? No, sorry. How would the app restore the in-app-purchase of a non-renewing subscription? Suppose I have an iPod and I subscribe to 1 month of listening to the Foo-radio. Now I want to also listen to the Foo-Radio on my iPad. Soo, I install the Foo-App on my iPad and tap the "restore" button. Well... what is the "restore" button supposed to do? How can it know if I already have purchased a "Foo"-subscription or not, and how long it will still be valid? Answer: it can not. This approach does not work.
In order for a non-renewing subscription to work, you have to login the user first, to tie the subscription to some online account. Username/Password, Open-ID, Login via Gmail, Facebook, etc. all would work. Then, when the user purchases an n-r subscription you have to store the fact that he subscribed on some server and link it to his account on the server. You also have to prevent the user from buying the n-r subscription when he is not already logged in. Let's continue with my iPod/iPad-example above. I download the app on my iPad, I login with Facebook, and voila, I can use the "Foo"-subscription now. There is no need for a "restore" button, because the app should check at login-time which subscriptions the user has.
There will be some additional problems to deal with. (1) For example, nothing prevents the user from logging in into 200 devices. Here the problem is not a user with 200 devices, but a university with 1000 students where 180 students share the same account. (2) If the server crashes, some people will probably lose their subscriptions. Problem (1) can potentially lead to decreased income. Problem (2) can lead to angry and unhappy customers.
From Apple: "Non-renewable subscriptions. Subscriptions that don’t involve delivering episodic content. Examples include access to a database of historic photos or a collection of flight maps. It’s your app’s responsibility to make the subscription available on all of the user’s devices and to let users restore the purchase. This product type is often used when your users already have an account on your server that you can use to identify them when restoring content. Expiration and the duration of the subscription are also left to your app (or your server) to implement and enforce." [Italics and bold added] https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html
Apple Reviewer's current-similar response about Non-Renewing Subscriptions "Your app offers Non-Renewing Subscriptions and this purchasability type must have its own restoring function - if you have removed it please re-implement it. Furthermore, your app must also offer a function, such as account creation, such that purchases can be tracked across all of a user's devices. Please implement a login feature as well as a restore mechanism prior to resubmitting your revised binary for review."

How do auto-renewable in-app-purchase subscriptions work?

My application currently allows the user to subscribe to our service using in-app purchase auto-renewable subscription. The app provides images, 12 images per month, and every month the user needs to renew his/her subscription to see the new content.
I haven't work on the auto-renewable model before, so I have built a model to validate the receipt and it works, but should I check if the user subscription expired or not, and, if so, how?
Also, does the app store only allow magazines and newspaper items to be auto-renewable?
I haven't worked on the auto-renewable model before, so any help on this matter would be highly appreciated.
When a user signs up for an auto-renewable subscription, they continue to be charged until they manually cancel it. This is obviously great from a developer’s point of view, because it takes a lot more effort to cancel something than to just let it continue.
You might already be familiar with a class of apps that use auto-renewable subscriptions already: Newsstand.
Newsstand was first introduced in iOS 5, and allows content providers to easily distribute their newspapers and magazines. With it, Apple introduced the auto-renewable subscription model, which allows you to set a subscription duration and manage renewals automatically through the StoreKit framework.
However, Apple has placed some very strict rules around auto-renewable subscriptions, meaning their usage is (usually) exclusive to Newsstand apps.
So sadly, if you want to provide content or features for a limited duration, outside of Newsstand, then your only option is to use non-renewing subscriptions.
found that here: http://www.raywenderlich.com/36270/in-app-purchases-non-renewing-subscription-tutorial
An auto-renewable subscription is an iOS In-App Purchase category that allows an app to provide and charge for content or features over a set amount of time.
Hear is a very useful link!. It provides almost every details about auto renewable subscription
Auto-Renewable In-App purchases continues charging the user (weekly/monthly/yearly etc.) until they cancel it.
You can check if the subscription has expired using the a validated receipt. It contains subscription expiration date and time.
If you want to lock content if subscription has not renewed, you may want to check receipt info against current date/time, on applicationDidBecomeActive delegate. There are open source libraries that lets you verify receipts locally as well.
And any kind of app can have Auto-Renewable In-App purchases, not just newsstand apps.

Resources