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

OnEvents() not working in background #2

Open
Warface opened this issue May 14, 2020 · 3 comments
Open

OnEvents() not working in background #2

Warface opened this issue May 14, 2020 · 3 comments

Comments

@Warface
Copy link

Warface commented May 14, 2020

Me again!

Seems that the OnEvents() is not fired in background when app is killed. It still track my position but the ajax call sending a push notification isn't working.

It works if app is "minimized" but the Worker doesn't seem to listen to the OnEvents() function so the push is not send.

@nickpatrick
Copy link
Contributor

nickpatrick commented May 21, 2020

@Warface When the app is killed, subsequent location updates will wake it up again. Make sure your JavaScript bundle is being parsed and your event listeners are being added even when the app is backgrounded. You may need to add the event listeners outside of your UI lifecycle.

@Warface
Copy link
Author

Warface commented May 21, 2020

The location is updated true but the event listener isn't firing if app is killed. I only have the location update, I need to fire the OnEvents() method too so I can send the push. Try it for yourself, you'll see that the OnEvents() does nothing when app is killed.

I've made a simple ajax call that post to FCM for sending push notifications which is working in foreground and app mininize(not killed). The push is working but when app is killed, nothing is sent.

My guess is the Worker working in background only works to update the location but not firing the listeners.

@Warface
Copy link
Author

Warface commented Jun 18, 2020

Any news on this topic. I saw that a new push has been made

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