Is the time-limited non-consumable IAP item allowed?

Hello,

I want to let some non-consumable IAP items just be sold during a particular period of time. And also I want that if the user have bought this item in this time period, after the item is not sold anymore, the user still can restore this item and use it.


When I test this in the IAP sandbox environment, though the IAP item is set to whether available or not, the item always can be bought. Just the redeem version can test the unavailable behaviour...... And also the unavailable item needs to be restored every time when you open the app. (Sometimes the restoring process will crash the app.... I don't know that it is caused by an iOS IAP bug or a UnityIAP bug.......)


So, my question is

1. Is the time-limited non-consumable IAP item allowed?

2. How can I test the unavailable IAP behaviour in the sandbox environment?

3. How can the user restore the unavailable IAP items which are bought when the item are available?


I tried to search this in the forum, stackoverflow & documentation and can not find the information about this.

Thanks,

Maplewing

Accepted Answer

1. Is the time-limited non-consumable IAP item allowed?


Yes. By turning on/off 'cleared for sale' you make the IAP available for sale, or not. A purchased IAP is always available for restoreCompletedTransactions whether or not it is 'Cleared for sale'.


2. How can I test the unavailable IAP behaviour in the sandbox environment?


You can't


3. How can the user restore the unavailable IAP items which are bought when the item are available?


The user can call restoreCompletedTransactions or the user can referesh the receipt and you can examine the receipt for the IAP field.


If your restore process is crashing you should fix that. The sandbox works pretty reliably.

OK! Thanks! I'll try to fix the restore process. 😀

But I found that I need to do the restore process every time for the unavailable IAP item when I open the app. It's not like the available IAP items can keep the restored information. Is it the expected behaviour or just caused by my wrong implementation? Thanks!

You need to store the fact that the user has purchased the IAP in some permanent memory - like a file or NSUserDefaults. You should store something that is 'encoded' - like the user's identifierForVendor. Then check to see if they have the correct value stored there. This is because it is easy for a user to change the value of a variable in NSUserDefaults like "Purchased" from NO to YES but they have no idea what their identifierForVendor is.

Is the time-limited non-consumable IAP item allowed?
 
 
Q