If the app is not inactive/running in background (app has been closed by iOS or force closed by the user) and a notification generated by this plugin is clicked, it will invoke the application but never call onNotificationClicked
I believe this is because didReceiveLocalNotification does not fire on cold start, and instead the plugin should also have an observer for didFinishLaunchingWithOptions to detect the app was invoked by a notification. Something like this:
Then a function like this to call the didRecieveLocalNotification handler inside the Geofence class
func didFinishLaunchingWithOptions(notification: NSNotification) {
log("didFinishLaunchingWithOptions")
let launchOptions = notification.userInfo!
let localNotification = (launchOptions[UIApplicationLaunchOptionsLocalNotificationKey] as! BooleanType)
if localNotification {
self.didReceiveLocalNotification(notification)
}
}
The problem here is this observer never receives a didFinishLaunchingWithOptions event: Some of this is a bit over my head, but I believe the cordova-plugin-app-event plugin should handle rebroadcasting this, but it doesn't seem to work.
If the app is not inactive/running in background (app has been closed by iOS or force closed by the user) and a notification generated by this plugin is clicked, it will invoke the application but never call
onNotificationClicked
I believe this is because
didReceiveLocalNotification
does not fire on cold start, and instead the plugin should also have an observer for didFinishLaunchingWithOptions to detect the app was invoked by a notification. Something like this:Then a function like this to call the
didRecieveLocalNotification
handler inside the Geofence classThe problem here is this observer never receives a
didFinishLaunchingWithOptions
event: Some of this is a bit over my head, but I believe the cordova-plugin-app-event plugin should handle rebroadcasting this, but it doesn't seem to work.