App only one time a day
How I make the app run one time a day, I mean, I open the app to do whatever (play, etc) but if I open the app again the same day , show a message that say "Sorry, you can play only one time a da开发者_运维百科y " or something like that. thanks!
Don't, you will annoy your customers. I'm presuming of course that this is some technique you are considering to get people who have downloaded a free app, to then go and purchase a paid app. If this is what you are after, consider what your app does and whether you can add further features to your paid version.
You could add an entry to NSUserDefaults marking the date/time the app is opened. From the point on when the app is opened check that value to see if it falls on the same day. If so then pop up your alert. If not, then change the value to the current date/time.
The application QRANK does this. It's a daily quiz game, with just one quiz available per day.
As for how to implement something like that, I'd just save the date and time of the last use, and compare to the saved value when the app launches again. If it's the same day, display a message to the effect that only one game/quiz/use is available each day.
精彩评论