IOS - Auto-Renew Subscription

Question 1:

I read the Apple docs regarding the subscription, but I'm still not sure if you can get the expiration date of the auto-renewal subscription from the moment you receive it without contacting Apple servers with iOS 9? It makes sense?

Question 2

Currently, what I'm doing to renew my auto-renewal subscription is:

  • use [[NSBundle mainBundle] appStoreReceiptURL] and start converting the receipt to a base 64 string

  • create a dictionary in which I include receipt data and a shared secret

  • convert this dictionary to json string

  • send this JSON string to https://sandbox.itunes.apple.com/verifyReceipt

  • returns a JSONized receipt receipt dictionary that was received as a response from the application store

  • get expiration_time from expires_date_ms inside last_receipt_info dictionary

I’m not quite sure that this is correct, because according to the documentation it is impossible to achieve a secure connection between the App Store and the device (which I am currently doing). In fact, the documentation states that I need my own server that will communicate with the App Store for me ( https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref / doc / uid / TP40010573-CH104-SW1 ).

Is this an acceptable approach or do I need my own server? If I need my own server, can someone help me in the right direction, how to do this?

N.B: , OpenSSL. .

.

+4
1

Auto-Renewable .

1) , . ( Base 64) , ( )

2) . , .

3) apple, .

4) , Apple . - , . .

, .

+2

Source: https://habr.com/ru/post/1620730/


All Articles