Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer should be visible even when the app is minimised #10

Open
astronomersiva opened this issue Nov 14, 2018 · 1 comment
Open

Timer should be visible even when the app is minimised #10

astronomersiva opened this issue Nov 14, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@astronomersiva
Copy link
Member

This is badly needed to enable quickly switching to the camera.

@astronomersiva astronomersiva added the enhancement New feature or request label Nov 14, 2018
@astronomersiva
Copy link
Member Author

@heykishan, I was thinking if we could schedule a notification for say, T-10 seconds to launch. Having an always visible, self-updating notification with react-native seems impossible, at least based on my Google-fu 😆

We will have to make sure we do not trigger duplicate notifications but this can be easily handled by persisting the launch timestamp in AsyncStorage. If there is an entry for that timestamp, we can just skip scheduling another notification.

AFAIK, the only thing we will have to figure out is what to do if a launch gets postponed. It would be funny to send a false notification. One idea is to have a last modified time kind of stamp in storage, similar to:

// assume 123 is the launch timestamp(launch time as unix epoch)
{
    123: notificationId-lastModifiedTime // from the API response
}

This way, if the API response's last modified time doesn't match the one persisted(which we can extract by doing a simple .split('-'), we cancel the scheduled notification and schedule another one.

Please let me know what you think of this approach and if there's some other easy path that we could take. I really want to keep this codebase as simple as possible 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant