cowbell / cordova-plugin-geofence

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

Type '(notificationData: any) => void' is not assignable to type '() => Observable<any>' for onNotificationClicked #192

Open vivekkalyan opened 7 years ago

vivekkalyan commented 7 years ago

I am attempting to set onNotificationClicked as shown below in Ionic 2

Geofence.onNotificationClicked = function (notificationData) {
          console.log('App opened from Geo Notification!', notificationData);
        };

but am getting the following error code:

Type '(notificationData: any) => void' is not assignable to type '() => Observable<any>'

I have already initialized the Geofence plugin.

  1. Can I use the native ionic 2 LocalNotifcations to read the notification instead? Would a notification issued by the geofence plugin also be handled by the LocalNotifications plugin?

  2. If not is it possible to show some example code of the onNotificationClicked in usage?