开发者

How to restore Auto Renewable Transaction in iPhone? (In App purchase)

开发者 https://www.devze.com 2023-03-31 13:54 出处:网络
In my application, renewing period is 1 m开发者_Go百科onth. Validity Time for Auto-Renewables in Sandbox is 5 minutes. So transcation identifier will keep on changing after each 5 minutes.

In my application, renewing period is 1 m开发者_Go百科onth. Validity Time for Auto-Renewables in Sandbox is 5 minutes. So transcation identifier will keep on changing after each 5 minutes.

Initially i will a buy the product. If I am successfull i will get SKPaymentTransaction object it contains all details about transcation like transactionIdentifier, transactionDate, transactionReceipt and transactionState. Till this I understood. If I call restore function, (i.e.restoreCompletedTransactions) I am getting all the completed transaction information. According to my knowledge the first transaction log information will be the late-stet transaction information.

When compare both the object's details are different. How come this is possible. I am totally confused, How to restore this Auto renewable transaction details. Any help is appreciated.


To confirm that user's subscription was renewed or not, restore completed transaction and send first transaction's receipt to apple. In response apple will send you current status of the transaction.

For detailed reference read following link http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2

Specially Table 7-2 Auto-renewable subscription info keys

After that send your data to apple in Json format (Note that receipt part has to base 64 encoded.) and read the response carefully. In response you will find codes given in above table depending upon situation.

Please note that in real environment receipt verification should be dome from another server not from iPhone or iPad itself.

Post here if you have any further doubts.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号