cowbell/cordova-plugin-geofence

onTransitionReceived() is called, but not notification shown.

SandervMaurik opened this issue · 2 comments

I am currently using this plugin with Ionic 3. I got the geofences working,and they seem to work when enter/leave geofence locations. The only problem is that the notification is not working. In the onTransitionReceived() I throw a toast, which is shown when entering the location/adding a fence. Also I hear a sound of a notification coming in, yet I do not see a notification....

I used a different plugin for local notifications to throw notifications. This worked, but I read that custom code in the onTransitionReceived() method is not working in the background... Which leads me back to using the standard notification that comes with this plugin which only makes a sound and no notification.

I'm kind of lost now....

My fence object:

let fence = {
            id: 1, //any unique ID
            latitude: <latitude>, //center of geofence radius
            longitude: <longitude>,
            radius: 200, //radius to edge of geofence in meters
            transitionType: 3, //see 'Transition Types' below
            notification: {
                id: 1,
                title: "Test",
                text: "Test",
                openAppOnClick: true
            }
        };

any update on this? I have the same behaviour.

I decided to use a background geolocation plugin, and manually create the geofencing functionality.