Hi,
We are working on an auto-renew subscription IAP and test it in the sandbox environment.
In this App, we add a restore button that will trigger restoreCompletedTransactions function by clicking. Then, the transactions would be restored in the callback function
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactionsAll of the transactions have a new transactionIdentifier after restoring, so we collect all of the transaction's identifier that transaction state is SKPaymentTransactionStateRestored in above function.
At the end of the function, we send the collected transactionIdetifiers with the grand unified receipt (got from [[NSBundle mainBundle] appStoreReceiptURL]) to our server side for validating with Apple.
After getting the decoded receipt from Apple, we found the transaction id belong the same auto-renew subscription IAP does not be updated. That means the restored transaction ids cannot be found in the receipt.
Would the transaction ids only be updated in transactionReceipt (but it's deprecated) but not in the receipt? Is this correct?
If yes, how would we know which restored transaction is matching the transaction in the receipt? If we don't know, how to finish the corresponding restored transaction after we handled it?
Thanks very much.
>That means the restored transaction ids cannot be found in the receipt.
That is correct, the value for transaction.transactionIdentifier in updatedTransactions will refer to that transaction - the one that is restoring the purchase. The transaction_id in the receipt will refer to the transaction that made the actual purchase.
When a device does a restore you need to communicate the transactionIdentifier, or some other id that indicates that device, to your server and associate that id to the receipt. The transactionIdentifier won't work since it will not be in the receipt.