2

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

3
  • Hi, it's have been a very long time. But do you remember if you have managed to use iCloud for restoring purchases?
    – mr.kostua
    Nov 23, 2022 at 12:07
  • 1
    I changed to receipt calculation method already, and it works very well now. I think Apple changed their policy after these years. If you still insist on using iCloud, it's simply save an Expiration Date on iCloud after completed purchase, just like NSUserDefault to save NSDate. But I regretted the use of iCloud, because I did that back in 2014, my app cannot be transferred to other account because of using iCloud
    – John
    Dec 2, 2022 at 6:22
  • Thanks for the answer (I have used receipt calculation method) @John
    – mr.kostua
    Dec 6, 2022 at 13:16

1 Answer 1

2

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];
9
  • Thanks for your answer. I did setup my app to restore this way: refreshing the receipt and re-calculate the expiration date. It works great. However, my app got rejected by Apple, they want me to have an optional registration for user to restore, or use iCloud. So don't restore it this way.
    – John
    Aug 8, 2014 at 17:31
  • Firstly, I am glad to hear that you figured it out. Secondly, I have already had my app approved. There is no need to use either iCloud or an optional registration. Take a look at progressconcepts.com/blog/… for a blog post I wrote on it earlier. If you want to reach out to me (see blog) I am happy to discuss further, but please do be assured Apple will approve this. Aug 8, 2014 at 20:42
  • Man, you got it approved? I got this instead: It would be appropriate to modify your app to include an optional user registration feature, to deliver subscription content to all of a user's iOS devices. Such user registration must be made optional, not required. We also recommend indicating that registering is required to access the subscription content from their other iOS devices - and providing a way to register later, if users wish to have access to this content at a future time.
    – John
    Aug 8, 2014 at 20:51
  • I really like the calculation from receipt way, it's neat and not as easy for users to cheat. Can you tell me more how to get approval?
    – John
    Aug 8, 2014 at 20:56
  • Did you include a restore subscription button? You need to ensure you include a restore purchase which will call SKReceiptRefresh to pull down the receipt to the other devices and iterate through the receipt to get the subscription information. Aug 8, 2014 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.