cowbell / cordova-plugin-geofence

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

onTransitionReceived() is called, but not notification shown. #268

Open SandervMaurik opened 6 years ago

SandervMaurik commented 6 years ago

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
            }
        };
aleixhub commented 5 years ago

any update on this? I have the same behaviour.

SandervMaurik commented 5 years ago

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