Click events not firing iOS
See original GitHub issueWARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Click events not firing when app closed. If app already open then click event fires as expected.
Your Environment
- Plugin version: 0.9.0-beta.2
- Platform: Mac OS
- OS version: 12.1
- Device manufacturer / model: All apple devices
- Cordova version (
cordova -v
): 8.0.0 - Cordova platform version (
cordova platform ls
): 4.5.5 - Plugin config
- Ionic Version (if using Ionic)
Expected Behavior
When app closed and notification clicked / opened click event should fire.
Actual Behavior
When app closed and notification clicked click event does not fire. If app already open, click event fires as expected with notification data. Android works as expected in both scenarios.
Context
Great plugin - well done. This was working fine, however has seemed to stop working with latest releases of iOS (12+)
var app = {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
onDeviceReady: function() {
cordova.plugins.notification.local.on("click", function (notification, state) {alert(JSON.stringify(notification));}, this);
},
receivedEvent: function(id) {}
};
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
Issue still persists Platform: Mac OS OS version: 12.1.4 Device manufacturer / model: iPhone Cordova version (cordova -v): 9.0.0 Cordova platform version (cordova platform ls): 4.5.5 Ionic plugin: ionic-native/local-notifications": “^5.3.0” Cordova plugin: cordova-plugin-local-notification": "0.9.0-beta.3
I’m sure, that the reason of this issue, is that other plugins (Firebase for ex.) overriding code, which reassigning delegate of notification center.
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
How to avoid that - I’m trying to figure out…