Using appStoreReceiptURL to restore non-renewing s

2019-05-24 12:45发布

I can use the receipt obtained by appStoreReceiptURL to retrieve the purchase date of non-renewing subscription. For non-renewing subscription, from the purchase date I could calculate the expiration date.

But when I try to restore using appStoreReceiptURL. I found that it returns nil on devices that did not make purchase even signing in with the same Apple ID.

Using

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

cannot update the receipts in appStoreReceiptURL. Did I do anything wrong here? Or is it just not possible to restore the receipts this way?

Thanks

1条回答
叛逆
2楼-- · 2019-05-24 13:02

You cannot restore the transactions in the way you are trying as they are consumables, and consumables have a finite life.

However, you could parse the receipt, and calculate the subscription period from this.

The receipt will be in the main bundle, but can be refreshed by using

recreq = [[SKReceiptRefreshRequest alloc] init];
        [recreq setDelegate:self];
        [recreq start];
查看更多
登录 后发表回答