cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
264 stars 318 forks source link

Geofence notification in background is working up to android version 7 only #297

Open Nirmala1498 opened 5 years ago

Nirmala1498 commented 5 years ago

Hi, Geofence Notification is not working in android versions above 7, I am using ionic v3 and want to use Ionic built in Geofence plugin. I have implemented as mentioned in the official docs https://ionicframework.com/docs/v3/native/geofence/

private addGeofence() { //options describing geofence let fence = { id: ‘69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb’, //any unique ID latitude: 37.285951, //center of geofence radius longitude: -121.936650, radius: 100, //radius to edge of geofence in meters transitionType: 3, //see ‘Transition Types’ below notification: { //notification settings id: 1, //any unique ID title: ‘You crossed a fence’, //notification title text: ‘You just arrived to Gliwice city center.’, //notification body openAppOnClick: true //open app when notification is tapped } }

this.geofence.addOrUpdate(fence).then( () => console.log(‘Geofence added’), (err) => console.log(‘Geofence failed to add’) ); }

The issue which i am getting is, i am unable to find out when it comes specifically inside or exit. In both cases, promise is returning success(which says ‘ok’). For notification purpose , i need to know specific condition based on entering and exiting.

Thanks in advance.