- Home /
Execute in background with huge delay on mobile
I'm making mobile game. And I want to send local notification on Android and iOS versions after huge delay. For example after 24 hours or week. It will be great if it works after rebooting device too. How can I realize it? Thanks!
Answer by Haerius · May 16, 2016 at 12:13 PM
This is how I would do it:
Store a bool and a float of the exact time-stamp inside your playerprefs. (The bool is so that you only execute the initial code once) Make a coroutine that runs every 5 minutes or so that compares the current time-stamp to the one you saved initially.
Sounds workable, but can't guaranty execution if user doesn't launch game... The first point why I need it - return users to the game. It means they don't launch it.
Oh I see... That I can't answer.. Never used the notification API before...
Your answer
![](https://koobas.hobune.stream/wayback/20220612080900im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scroll Rect draging delay 0 Answers
Endless runner background looping delayed. 0 Answers
Is there a unified solution for push notifications on both iOS and Android? 1 Answer
How can I unfocus and fade my background in a 2D game? 0 Answers
Amazon Simple Notification Service (SNS) AWS Mobile SDK for Unity 1 Answer