Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

ios - Auto-renewable subscription in ios7

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...