I
I
Ivan Vorobei2017-06-30 22:49:59
API
Ivan Vorobei, 2017-06-30 22:49:59

How to implement Auto-Renewable in iOS?

The task is to implement an application with a renewable subscription. We hide digital content behind the subscription. Digital content comes from the server
I would like to implement without accounts (login and password). i.e. I activated the subscription on the iPhone, the server delivers the content.
There were questions about the implementation
1) How can I directly check from my server whether the subscription is active?
2) What to send to the server as an ID? UDID is not an option if I open the application from the iPad - there is a different UDID, but the subscription will be renewed. You need something tied to your Apple ID. Is there a subscription ID?
3) Will the subscription ID be the same for all iOS devices linked to the same Apple ID? Or is the subscription only valid for one device?
4) How to organize all this into an operating system? I still see this option: the user activates the subscription, the device knocks on the server and says that the subscription is activated. Passes something that acts as an ID. The server creates a user and delivers content to that ID. Each time before sending content - the server checks with Apple or the subscription is active and paid. If I log in from a tablet, I will again send something like an ID (which ideally matches the iPhone) and get the content

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Beltyukov, 2017-07-06
@ivanvorobei

All 4 points will help you to do online validation of the purchase receipt. Briefly, it looks like this:
1. The application receives an application receipt from iOS (receipt). Upon receipt, it is desirable to update it.
2. The application sends a receipt to your server.
3. Your server makes a request to the AppStore with this receipt and shared secret.
4. The AppStore returns you a json containing information about all purchases in this application by the user with this Apple id.
5. In the information received, we are interested in:
a) original_purchase_date - the date of the subscription
b) purchase_date - the date of the last payment
c) is_trial_period - indicates that the user is using the trial period
d) cancellation_date - if not equal to null, the purchase was canceled
6. PROFIT!
The process is described in detail here: https://developer.apple.com/library/content/release...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question