cordova-plugin-radar icon indicating copy to clipboard operation
cordova-plugin-radar copied to clipboard

OnEvents() not working in background

Open Warface opened this issue 4 years ago • 3 comments

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.

Warface avatar May 14 '20 19:05 Warface

@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.

nickpatrick avatar May 21 '20 14:05 nickpatrick

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 avatar May 21 '20 14:05 Warface

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

Warface avatar Jun 18 '20 14:06 Warface