Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Restoring auto renewable subscription

I am implementing auto renewable subscription.In that i have got the below question

Can a user be able to restore the subscription content even after it is expired?

if so how can i validate them and let them to download

like image 428
user198725878 Avatar asked Aug 20 '12 09:08

user198725878


1 Answers

Look at Restoring Auto-Renewable Subscriptions

Basically you need to call [[SKPaymentQueue defaultQueue] restoreCompletedTransactions] and you'll get back restored transactions. You should look at originalTransaction property. You'll know transaction date for each transaction(also for expired ones). Then you look at product identifier and your app should know what's the lenght of subscription for each product identifier. And since you know start date and lenght of each transaction you can calculate time periods during which subscription was valid. You validate them as any other transaction - send them to your server which will send then to http://buy.itunes.apple.com/verifyReceipt (change buy to sandbox for testing).

like image 115
Michal Avatar answered Sep 19 '22 04:09

Michal