Do auto-renewable subscriptions send an SKPaymentTransactionStatePurchased transaction when they auto-renew?

前端 未结 1 467
北海茫月
北海茫月 2020-12-16 16:05

Does the AppStore send out a transaction when it auto-renews an auto-renewable subscription? If so, can it reliably be detected by an App the next time the App loads if it

相关标签:
1条回答
  • 2020-12-16 16:21

    After some research I can answer my own question and raise another related issue. The App Store calls the paymentQueue and posts a transaction. The transaction is posted with transaction.transactionState==SKPaymentTransactionStateRestored, not transaction.transactionState==SKPaymentTransactionStatePurchased.

    The issue is that unfortunately this gets posted only to one device. A second device does not get the posting. Therefore, to detect the auto-renewal, or rather to detect the lack of an autorenewal and deny the device a continuing subscription, you have to do a restoreCompletedTransaction or "http post a 64-bit encoded JSON containing the last transaction". If the fomer, the user needs to give their password; that's intrusive. If the latter, lots of additional coding is required. So, my question is...why doesn't StoreKit have a command:

    (does not exist) - [[SKPaymentQueue defaultQueue] restoreAttachedTransactions:(NSArray *)transactions];

    This command would flow just like a restoreCompletedtRansactions but it would only restore the attached transactions and, most importantly, it would not require log-in by the user. It has the same security protection as the "http post a 64-bit encoded JSON containing the last transaction" and it allows the entire In App Purchase process to be done in StoreKit rather than requiring web posting code.

    If this makes sense to you, please suggest how to get this to Apple....thanks.

    0 讨论(0)
提交回复
热议问题