I’m making a game app in X Code. The users win and lose “coins” as they play. I understand that Apple requires that you make sure they eventually get more currency for free if they run out. I am going to have in IAP. However I want to put in some kind of time or other method to give them say 100 additional coins every day. So that if they run out they come back and will have a little more currency to play.
I’m very new and if anyone can suggest a simple way to do this it would be greatly appreciated.
Currently I store the currency in a long long variable called “coins”. I am also using NSUserDefalts to store the amount of “coins”. I am going to use that for the IAP.
Thank You!
Store the last time that you have given the user his free coins along with the remaining coins in the user defaults. Whenever you check the remaining “balance” of the coins, look at that additional variable, and compare it to the current time. If the difference is greater than 24 hours, give the user additional coins, and store the new value in the defaults.