I'm trying to implement Auto Renewable Subscriptions. My app can be used across different devices (Android, Web) so I needed to implement the Status Polling technique in order to acknowledge my server when App Store manages to renew an expired subscription.
The receipt is being verified on my server as elaborated here.
On each transaction made on the device, I update the user's entry on the database for the last_receipt_base64
field during the receipt verification process.
On each status polling, I want to update the last_receipt_base64
and expired_date
fields, so I take the last_receipt_base64
and send it to apple's /verifyReceipt
route. But each time it puts a different receipt (base64) under the 'latest_receipt' key. Even more, the length of the returned (from /verifyReceipt
) receipt base 64 is strangely much shorter than the receipt sent from the device (35,000 chars receipt from device, 6000 chars receipt returned from /verifyReceipt
). Why is that?
I want to update the entries on my database on each status pole if there's a change but the data keeps changing! Also the extreme length differences between the receipts from the device and /verifyReceipt
makes me worried that the receipt might be rejected someday, If a user won't login the iOS app for long time.
Anyway I'm a bit confused, and the docs aren't very good... Some guidelines will be helpful.