问题
I know it has been asked many times but none of the questions are helping me and I am not sure which of these answers are still valid in iOS 7.
I am doing some app with Auto-Renewing subscription. I have successfully created my product and I can buy it with test users.
My question is: What is the right way to check if a particular user still has access to this product?
And how to test if auto-renewing is working well? (Since I read that in sandbox auto-renewing does not work as real iStore).
Last question is: Is it still true that Apple rejects a lot of ARS apps?
Marko
回答1:
To check if a user still has access to the product you should store the receipt data you received during the payment and check that receipt with the app store service.
The app store service will reply with a status for your receipt (0 for valid receipt, 21006 if the subscription has expired and was not renewed, etc)
The process with sample code can be found here :
https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW3
To answer your last question : Yes Apple rejects a lot of ARS apps, it only works for content apps (magazine, newspaper, videos, etc). For example if you offer a service such as dropbox your app is not eligible to ARS
In our case we are distributing a book subscription service, to validate the app Apple asked us how many new content is available to users every month.
edit
For iOS 7 status 0 represents a valid receipt even if it's expired :
For iOS 7 style app receipts, the status code is reflects the status of the app receipt as a whole. For example, if you send a valid app receipt that contains an expired subscription, the response is 0 because the receipt as a whole is valid.
You need to verify the latest_receipt_info expires_date.
回答2:
Recently Apple has launched a new feature to receive server side notification whenever the subscription is renewed. However, the subscription should be in-app.
See the links given below for your reference:
https://help.apple.com/itunes-connect/developer/#/dev0067a330b
&
https://itunespartner.apple.com/en/apps/news/45333106?sc_cid=ITC-AP-ENREC
回答3:
Apple does not provide anything built into iOS or a REST API that gives you simple subscription details, nor are there any callbacks that you can listen for and respond to in regards to renewal or cancellation. Apple does have an API that, when given a user's local receipt and a “shared secret” generated in iTunes Connect, returns a JSON object of the user's purchase history for your app, including their current subscription information.In-App purchase doc
来源:https://stackoverflow.com/questions/22680059/auto-renewable-subscription-in-ios7