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

Persisting the background service after device restart #2

Closed
AnthonySmith01 opened this issue Dec 21, 2016 · 2 comments
Closed

Persisting the background service after device restart #2

AnthonySmith01 opened this issue Dec 21, 2016 · 2 comments

Comments

@AnthonySmith01
Copy link

Hi

Thanks for this great project.

Quick question, is there anyway to make this background service trigger or persist after a full device restart?

@ivanbuhov
Copy link
Contributor

ivanbuhov commented Dec 22, 2016

Hi @SM1DDY
In the iOS world it is hard (someone may say impossible) to trigger a background task on boot. Technically there is no such API or mechanism but some workarounds exist. Keep in mind that these restrictions exist for native iOS applications too. You can find more in-depth information in this SO answer.

@AnthonySmith01
Copy link
Author

AnthonySmith01 commented Dec 23, 2016

Thanks mate, much appreciated.

Update (for others looking at this):
My app relies on location services so I got around the "reboot" issue by using the significant location change api. Basically, the significant change api wakes the app whenever the device has moved about 500m (according to Apple). This also persists across reboots.

I made a simple/rough solution by modifying the nativescript-geolocation module as mentioned in this issue:
NativeScript/nativescript-geolocation#44

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

No branches or pull requests

2 participants