iOS In-App Purchase: Managing auto-renewing subscriptions - ios

I'm currently working on incorporating in-app purchases into an iOS application. The primary offering will be auto-renewing-subscription based. My question concerns subscription management.
It is not possible (AFAIK) to manage AR subscriptions in the sandbox environment. Apple's documentation here on expiration and renewal and here on managing subscriptions indicate that the user may disable auto-renewal and then renew it at a later date. In the event of a disable action taken from the device AppStore, does the auto-renew option remain available in perpetuity -- e.g., in the IAP programming guide example there is a lapse of about two months before the user renews. What about a year? I assume that since the record of the AR transaction persists indefinitely, so does the App Store capability to manage the subscription? I also assume that a caveat here would be that the product offering was still available in the store.
Anyone have any experience with this?

From my experience as a user, I was subscribed to an auto-renewal app and then turned off renewals. My subscription expired Jan. 27, 2015 (5 months ago) and I deleted the app from my phone soon after. After deleting the app, the renewal settings for it disappeared from my iTunes Store > Apple ID > Manage Subscriptions section. Today, to check your question, I just reinstalled the app and the renewal settings reappeared in Manage Subscriptions, including correct information about the expiration date and options to renew (resume) my subscription.

Related

Validate iOS auto-renewable subscriptions from multiple apps

I work for a game developing company which releases at least one game a month. For our true fans we want to start providing a subscription to our games, so they can play all our games (on any platform) without constantly having to buy them.
The idea for iOS is to use the in-app auto-renewable subscription. This results into a receipt which we store in our backend. The backend can validate this receipt and provide the apps with information about the subscription of the user.
This system will solve a lot of problems: You can take the subscription in 1 game, and play all the games as well, on any device you like.
But now we come to the problem: After a month the receipt is not valid anymore, and we need to check in the iTunes store to see if the user still has a valid subscription.
My first idea was to use the "latest_receipt_info" field, to get the latest receipt and validate this. But according the documentation this feature should only be used for iOS 6 receipts:
"Only returned for iOS 6 style transaction receipts for auto-renewable
subscriptions."
source:
https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-
Even though I can actually still use this field with my brandnew iOS 10 receipt, I don't think it's smart to use it since it's deprecated.
(another source telling you shouldn't use it anymore: https://forums.developer.apple.com/message/156580#156580)
The advised solution of apple is to implement a SKPaymentTransactionObserver in the app. This will retrieve the latest receipt when it's available, and send this to the backend. Even though this is far from ideal, this could work... however:
This means the app has to be active to retrieve the latest receipt. And in our case it's very well possible a user takes a subscription in app1, and after a couple of days downloads app2, 3 and 4, but never uses app1 again. So in this case the latest receipt will never be fetched (because only the observer of app1 can access the receipt)
To fix this problem we should be able to fetch the receipts from this subscription from any app in our subscription group. But according the documentation on the apple site (https://developer.apple.com/app-store/subscriptions/ ) you can only access a subscription from 1 app, and you have to do the multiple app thing yourself:
You can offer auto-renewable
subscriptions to access multiple apps in your portfolio. Each app must
be approved to use auto-renewable in-app purchases and must be
published under the same developer name on the App Store.
In iTunes Connect, you’ll need to set up separate and equivalent
auto-renewable in-app purchases in each app offered in the multi-app
subscription so that users can subscribe from any app. To avoid users
paying multiple times for the same offering, you are responsible for
verifying that they are subscribers in one of the apps before showing
any subscription options. To do this, consider maintaining an account
management system in which users create an account with your business
to sign in to each app.
So is there any way to do what we want, without forcing the user to go back to the app he used to purchase the subscription every month?
On the last WWDC we went to StoreKit labs and personally asked StoreKit evangelist about this. We were told that the 'latest_receipt_info' field return by iTunes validateReceipt endpoint is exactly what we are suppose to use in order to check if the subscription was renewed or not.
This is not going to be deprecated in the near future but they do have plans for adding some server-to-server communication that solve few of the problems we ran into:
Your server will be able to get notification from Apple regarding any subscription renewal, cancellation, downgrades etc.
In the latest_receipt_info returned by the validateReceipt endpoint few fields will be added, providing information like whether the subscription will be renewed after current one is expired, whether there was a problem charging the user's credit card etc.
Sources:
WWDC 2017 Session 303 - What's new in StoreKit
WWDC 2017 Session 305 - Advanced StoreKit

In-App Subscription Tiers?

I am researching in-app purchase viability in my app and have some queries.
Is it possible to have a multi -tiered subscription model with in-app purchase on iOS?
E.g. 4.99 for Basic, 9.99 for Advanced.
I would need the user to be able to change tier as and when they wanted, just as you would expect from any subscription service.
Is that possible? Does Apple support this?
Yes it's possible by opting out of the current subscription and then buying the Advanced Tier.
https://developer.apple.com/in-app-purchase/In-App-Purchase-Guidelines.pdf
Subscriptions and subscription renewals to content or services can be offered to customers for purchase.
!Renewal of an Auto-Renewing Subscription is handled automatically by the App Store. The user will be reminded shortly before their subscription is about to renew and all the billing is handled automatically by the App Store. Users can easily change their renewal frequency and can opt-out of the renewal by turning off the Auto-Renew switch at least 24 hours before the end of the current subscription period.

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.

Free trial period of premium service

Although I searched a lot on this site and used Google as well, I cannot find a good solution for my problem.
I'm creating an app that offers a paid web service as an option. I would like give away a initial period of this service and link this to the purchase date of the app.
The Daily app is doing something similar. After downloading the app, you can read The Daily for two weeks for free. After that time, you have to subscribe.
Your help would be highly appreciated!
From Apple's developer guidelines:
Apps using IAP to purchase physical goods or goods and services used outside of the application will be rejected
If your premium web service is at all useable outside the app itself, in-app-purchase won't be a solution, so you'll have to implement the logic on your server, based on user names, etc.
If, however, it's simply a web service that iOS accesses—think if Instagram offered a paid upgrade in the days before their Android app—then you could use IAP subscriptions to do the trick. Again, from Apple's documentation:
Auto-renewable subscriptions are delivered to all of a user’s devices in the same way as non-consumable products. However, auto-renewable subscriptions differ in other ways. When you create an auto-renewable subscription in iTunes Connect, you choose the duration of the subscription. The App Store automatically renews the subscription each time its term expires. If the user chooses to not allow the subscription to be renewed, the user’s access to the subscription is revoked after the subscription expires. Your application is responsible for validating whether a subscription is currently active and can also receive an updated receipt for the most recent transaction.
As a side note, it looks like Apple are about to implement free trials, but haven't quite done it yet (there are some interesting hints in some of the documentation, but there's not an option when creating an IAP subscription yet).
I suggest you put some UI in that invites users to subscribe to the free service, and save that YES/NO answer along with the [NSDate date] in a defaults variable synced to iCloud. This means that it will be tied to their Apple ID, and can't easily be deleted by removing the app—next time they install it, you can restore that preference key.
Then, once the trial period is up, bring up your custom UI (since all the IAP UI is custom!) that gives people the chance to subscribe to an ongoing service using the auto-renewable subscription.

IOS subscription end notification

I am looking to build a ios application that will use an auto-renewable subscription on a monthly biases. We will be using some VOIP features that we will be charged monthly for. My question is, how can we be notified when a user cancels a subscription in IOS, so that we can cancel the users VOIP telephone number with our provider.
You will need to verify the receipt the same way you do for regular In App Purchases, but obviously you will do this every time the subscription period expires. Check out the documentation on this, Verifying an Auto-renewable Subscription Receipt
So based on this, it appears you will need to setup your server to check for a valid subscription every month (cron job?). This will allow you to cancel the VOIP number in your system if the subscription is no longer valid. Your app would be responsible for verifying a subscription is still valid when it is opened or the user attempts to access features that require a subscription.
Updated For Comment
The sandbox is supposed to return expiration dates in the following scheme.
This is from page 164 of the iTunes Connect Developer Guide
If it is not working this way you may want to file a bug report.
Also, please not the following from Apples IAP doc:
Additionally, a sandbox subscription will only autorenew a maximum of 6 times. After the subscription has auto-renewed 6 times, it will no longer renew in the sandbox.

Resources