cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
265 stars 316 forks source link

Geofencing plugin works with app in background or killed? #128

Closed vmfo22 closed 8 years ago

vmfo22 commented 8 years ago

I'm trying to use the plugin but on of the requirement is that i can receive notifications when the application is in background or killed. The plugin supports this? With the tests that I made didn't work.

frmi commented 8 years ago

Have you looked at this issue #35 ?

vmfo22 commented 8 years ago

Thanks, I didn't see this issue. But from my side, in iOS after I killed the application I don't receive notifications. Only receive when the app is open or in background.

This is weird because the Location Manager runs in background as a service.

johnrobertcobbold commented 8 years ago

@vmfo22 Two easy steps to make it happen : (1) Check your logs, is your app being re-launched by iOS when the geofence is triggered ? If so, you are on the good way. (2) Make sure that you re-inject the window.geofence.onTransitionReceived before you call window.geofence.initialize() on app launch. That will make the callbacks trigger.

vmfo22 commented 8 years ago

@johnrobertcobbold Thanks for the suggestions. The problem was in my side my application had more view controllers and in one of them there is something that cause the problem stated. If I remove this View Controller the plugin works fine. It's weird but isn't a problem on the plugin.