开发者

Do auto-renewable subscriptions send an SKPaymentTransactionStatePurchased/Restored transaction when they auto-renew in test mode?

I was looking to this thread.

It's stated that the App Store calls the paymentQueue and posts a transaction with transaction.transactionState==SKPaymentTransactionStateRestored.

But I'm not getting those calls. I'm testing

  1. with sandbox accounts/subscriptions, that expire and are auto-renewed every 3 minutes;
  2. WITHOUT verifying receipts.

This way, my updatedTransaction method is never called after the first buy.

Anyway, if I later on restore completed transactions, I get all the receipts.

Any experience with sandbox? Also, the point 2) is needed or (as I think) it's o开发者_如何转开发ptional?


The state: SKPaymentTransactionStateRestored is only determined if you have the receipt on the user's device and you use it to make the transaction. If you do not have the receipt, then you will need to call restoreCompletedTransactions to decide whether to apply the auto-renewed subscription.

The situation when you won't have a receipt is when the user buys an auto-renewable subscription, then deletes the app or installs the app on a different device. In other cases, you can safely store the receipt on the device.

The issue is detecting the case when the user has purchased an auto-renewing subscription and needs to have the content activated. Without a receipt, if you trigger the transaction, it will fail with the state SKPaymentTransactionStateFailed. Looking at the error code, you will see SKErrorPaymentCancelled. This, as far as I can tell, is a bug on Apple's part. You will need to make the best decision for your app to deal with it :/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜