-
Notifications
You must be signed in to change notification settings - Fork 239
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
Own database question. #1374
Comments
The background state != the terminated state. Android headless-mode is for the terminated state, not background. For iOS, you only need to implement |
Ok, so correct me if I'm wrong but I probably meant the terminal state. (The case when the user switches the application or locks the phone for a long time. (We track the user's walk)). Generally I needs to have the exact same locations events saved as your package. So if the app is to track a user's walk, I have to assume that it collects locations even if the phone remains locked for a long time. In that case, the system may close the app, as far as I know, but your package still collects locations. In summary, I probably need the same location events as your package collects. Is it possible with your package? Additional question: |
iOS and Android are fundamentally different in the terminated state. AndroidWhen an Android app is terminated, the OS allows services to continue running "headless". All events while your app is terminated are forwarded to your registered headless-task. To implement a custom database, you must do you iOSWhen an iOS app is terminated (either by user or OS), absolutely everything is stopped. There is nothing running. The only thing that will re-awaken a terminated iOS app is to move at least 200 meters, when the OS will automatically relaunch your app in the background, just as if launched from the home-screen icon. All locations will be delivered to your |
It's really helpful. It allows me to save all events in the database. I assumed that if headless-task is only for Android, then for iOS it is not possible to save the location in the terminal state in the database. But if I understand correct that for ios terminal state the application is started and .onLocation is called. So for ios, just save the .onLocation events to storage and it should work fine even in the terminal state. Please confirm that I understand this correctly so that I can rest easy. And once again thank you for your answers, they are really helpful |
Like I said above:
|
Today I implemented the solution on andorid and in terminal state I have the following problem. Maybe you know what the problem is?
` |
Maybe you have an error in that file. |
My config:
|
I suggest you test in a simple hello-world app. Do nothing more in your headless-task but a simple |
Hi, I use your package and it is great. Thanks for your work.
I would like to ask about one thing. I need to synchronize location events with the server, but also save them locally.
You answered a similar question here
#1318 (comment)
Your answer:
So you indicated that it is possible to create your own database.
Can you tell me how it is possible, how I can listen to location events and save them in the background to my database? I thought about bg.BackgroundGeolocation.registerHeadlessTask but from what I understand it is only for Android. I would like it to work for ios and Android in the background. Will appreciate any tip and link to documentation 😄
The text was updated successfully, but these errors were encountered: