Subscription Renewal Without callback

Hi everyone!


It's possible i will check if subscription was renewal without server-to-server callback?
For example:
Any expires date of my period-table, i send a request for apple backend and get the status of specif user subscription?
I did read the verifyRecipt documentation but i don't understood.
Thanks.

Replies

You don't need to do any server-to-server stuff. You don't need to verify a receipt. Just use calls to updatedTransactions to tell the app on that device that the subscription has been renewed. If the subscription appears to have expired then use restoreCompletedTransactions to get an updated call to updatedTransactions. I believe you can use the following information in the array of transactions returned in updatedTransactions to calculate the expiration date of the subscription:


transaction.transactionDate

transaction.payment.productIdentifier (e.g. - 1 month or 3 months or 1 year)


Unfortunately, I am not certain that the transactionDate property is the date of purchase or the date of the restoreCompletedTransactions (i.e. now). If it is the later, then you could explore using


transaction.originalTransactionIdentifier.transactionDate


but I am not sure whether, for an autorenewable subscription, this is the original subscription purchase date or the latest renewal.


If neither gives you the date of the purchase then you have to decode the receipt either on board or by sending it to the apple servers.