Setting expiry date for Non-Renewable subscription using storekit - ios

I am writing a non-renewable subscription module for my new application. It includes 1 month, 3 month and 6 month subscription period. I do not understand, how to set expiry date using icloud. Any help would be appreciated?

For Apple, there is no "within the validity period" for non-renewing subscriptions. The duration of the period, fortunately or unfortunately, is left up to the developer.
Subscription validity/expiry date is up to the developer.
It seems common for developers to use their own server to track the expiry period of a non-renewing subscription.
"So if When you use iCloud for restoration you should have to manage expiry date on your own server..."
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.
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html
Hope it help you.

Related

Consumable vs. Non-renewing vs. Renewing Subscriptions in iOS

I have created my first app and I am almost ready to submit it to the Appstore. I have spent the entirety of the last few months of quarantine focusing on this app so I am implementing a subscription in app purchase in order to repay my efforts while simultaneously adding value to my customers. There is great probability that this app will succeed.
I would like to offer 1 month, 6 months, and 12 month subscriptions. I have looked into auto-renewing subscriptions but when it comes to checking the subscription status of a user I have quickly noticed how complicated everything is with Apple's encrypted receipts.
I would like to offer subscriptions but it seem that I will be unable to offer auto-renewing subscriptions as I have absolutely no clue how to decrypt and parse Apple's receipts and resources online seem feeble.
Would it be best/easiest to have my subscriptions as non-renewable or even consumables? This way I could track my users subscription status on my own backend without the added layer of complexity that comes with parsing encrypted data from Apple.
From a business perspective, notifying a user that their subscription is ending is certainly not as effective as auto-renewing it. Will there be a noticeable difference in revenue if I set my subscriptions to consumables or non-renewing?
I thank the community ahead of time for its insights.
In your case, if you don't want to waste your time on handling auto-renewable subscriptions, you can use subscriptions backend as a service like ours or competitor's: Apphud or RevenueCat. We do exactly what you need. Hope that helps, thanks.
Auto renewable subscriptions would be the best option for you in terms of revenue. Although customers are notified by the apple itself for renewal deduction so you just need a backend services which will be keep on tracking on extending the user subscriptions through the initial receipt stored in your databases.
You need to use meta data from the receipt under key "latest_receipt" to get the latest update in the subscription.
Below is the link for reference.
https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store#//apple_ref/doc/uid/TP40010573-CH104-SW1

How to grant free months to an auto-renewal subscription (iOS)?

I have an iOS app with different auto-renewal subscription possibilities, and I want to offer it's user the chance to earn a free month when they invite friends to the app.
I know how to handle the scenario where I'd give a free month to a user that's not already subscribed, but I'm wondering how to handle a user that's in the middle of a year-long paid subscription and should receive a free month..
EDIT
Make sure to read budiDino reply below, it seems this is now possible (Full disclosure, I haven't tried it myself but I did glance over the references linked).
OLD ANSWER
Ok, after some digging and asking around on Apple's forums I can confirm it's not possible.
The only way to achieve this is to give users a free month outside of Apple's subscription process...meaning users should turn off auto renewal to enjoy those free months.
Whether this is good or bad for your app depends, but it required that the user manually turns off auto-renewal while using the earner out of charge time, and then turn it on to get back into the normal auto-renewal flow handled by Apple.
You can maintain a value like additionalMonths on your server side.
So once his subscription period gets over, you can check for the value of additionalMonths and accordingly provide him subscription for those number of months.
1. Promotional Offers
This option allows you to add a free or discounted price for a period that you specify and it will be executed before the next payment cycle. You can use this feature starting with iOS 12.2.
Apple Documentation:
You can provide lapsed or current subscribers a limited-time offer of a discounted or free period of service for auto-renewable subscriptions on macOS, iOS, and tvOS.
Some useful links:
Implementing Promotional Offers in Your App
Set up promotional offers for auto-renewable subscriptions
Subscription Offers Best Practices video - WWDC 2019.
2. Offer Codes
Apple Documentation:
Offer codes can help you acquire, retain, and win back subscribers by providing a subscription at a discount or for free for a limited time.
Read more
3. "Extend a Subscription Renewal Date" endpoint:
Potentially simpler alternative that is not really suggested to use for this use-case. It has certain limitations though:
you can move the renewal date for a customer’s subscription up to 90 days into the future for each extension
you can extend the renewal date twice within a year (365 days) per customer
The following types of subscriptions aren’t eligible for renewal date extensions:
Subscriptions in a free offer period
Inactive subscriptions in a billing retry state
Subscriptions in a grace period state, with an expiration date in the past
Subscriptions that have already received two renewal date extensions within the last 365 days
Read more

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.

Non-Renewable subscription in IOS

I was using "Auto-Renewable subscription" and it was working perfect and i can verify its recipt and can check status that its active or not, but apple has rejected it and suggested to use "Non-Renewable subscription", main problem using it is that, i can not test its status when after subscription, it expire or user remove it from his apple account, "Auto-Renewable subscription" use to expire after few minute so it was easy to test.
Can any one suggest how to test this scenario
With Non-Renewable Subscriptions you need to manage it yourself, on your server. Once you verify a receipt with Apple, the ball is in your court to calculate and maintain the expiration date. As an example, there's nothing stopping you from selling 1-month subscriptions but giving every one an extra week since you're calculating your own expiration date. Also beware that now you have to sync the subscription across all their device. With ARS you could use restoreCompletedTransactions to extend a subscription to a person's new device. But with NRS, Apple requires you to implement a user account system with username and password to allow a user to log in (to your server) and extend their subscription to a new device.
With NRS you have more power but you also have a lot more responsibility.

Is there a monthly subscription model for iOS that resets each month?

I'm launching an app that I would like to offer for free each month up to a certain usage level. If the user exceeds the threshold, the app would charge them a monthly subscription. However, I don't want the subscription to automatically renew each month. Rather, I would like the usage level to reset the following month, and if the user does not exceed the threshold, the app is free for that month.
Any creative ideas about how to make this happen?
Yes, look at Apple Overview of In-App Purchase:
Non-renewing subscriptions are a mechanism for creating products with a limited duration. Non-renewing subscriptions differ from auto-renewable subscriptions in a few key ways:
The term of the subscription is not declared when you create the product in iTunes Connect; your application is responsible for providing this information to the user. In most cases, you would include the term of the subscription in the description of your product.
Non-renewing subscriptions may be purchased multiple times (like a consumable product) and are not automatically renewed by the App Store. You are responsible for implementing the renewal process inside your application. Specifically, your application must recognize when the subscription has expired and prompt the user to purchase the product again.
You are required to deliver non-renewing subscriptions to all devices owned by the user. Non-renewing subscriptions are not automatically synchronized to all devices by Store Kit; you must implement this infrastructure yourself. For example, most subscriptions are provided by an external server; your server would need to implement a mechanism to identify users and associate subscription purchases with the user who purchased them.
You can track the user usage and ask him to buy your Non-renewing subscriptions* if the usage exceeds the threshold. Then at the end of the subscription you can check it again and ask him to pay again for the next month.
I would consider using renewable subscriptions for users that know that their usage will
always exceed the threshold.

Resources