-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS error when using both Firebasex and Local Notifications: "FirebasePlugin[native]: willPresentNotification: aborting as not a supported UNNotificationTrigger" #230
Comments
The problem is that both this plugin and This is a conflict between the two plugins (see this SO post for further info about multiple delegates) . The best solution would be implement a common shared delegate which broadcast an event which both plugins could add observers for, meaning both plugins would receive the notification event. Therefore this isn't something that's an easy bugfix and I'm unlikely to attempt to fix this in the near future. FYI I see no commits in the repo in the issue you referenced but please feel free to point out if I have missed that particular piece of code. |
Hey @dpa99c, Thanks for you quick answer! Thanks! |
…iOS" Upon testing, this plugin does not work with `cordova-plugin-local-notification` present in the same project even with this code in place. Therefore removing it should stop the crashes occurring in #385. And the conflict between the 2 plugins will need to be addressed separately under #230. This reverts commit 4e9a0f4: > co-existence with cordova-plugin-local-notification on iOS > Local notifications on iOS via cordova-plugin-local-notification are working again. >Click-callback for remote notifications not working right now. >Details: >UNUserNotificationCenter accepts a single delegate that handles the display of notifications. cordova-plugin-firebase now stores a reference to the existing delegate if any and proxies the delegate-calls (cordova-plugin-local-notification is >already doing that in the other direction when applicable).
Related to this in #443: I believe to resolve this issue, both this plugin and |
Hi @dpa99c ! The problem is the same with release 11.0.1-cli. Could you give me advice how to use it, with cordova-plugin-local-notification plugin ? Thanks! |
@golyo due to the nature of the conflict between this plugin and |
I am using https://github.com/katzer/cordova-plugin-local-notifications version: 0.9.0-beta.3 and https://github.com/wizpanda/cordova-plugin-firebase-lib version: 5.1.1 both are working on iOS. I can fire off background/foreground local and remote notifications. @dpa99c |
Looking at the code in the cordova-local-notification I noticed UNUserNotificationCenter is a singleton and that in must be initialized prior to this plugin via the local notifications plugin, so i created a PR holding previous instance if exists and using it if notification not supported. This behaviour actually seems existent in that plugin (just with instances and not as static). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Could someone solve this problem? Any solution from some plugin? |
Still having the same problem... |
I had this problem too, and I resolved it with this code:
When you receive a notification from the local-notification-plugin, you can see it in the message.meta.plugin property. Since I don't need to do anything when my local notification triggers, I just return, but you can do your custom logic there I guess, like showing a popup. PS: note that I'm using cordova-plugin-local-notification-12, but you can change it with the plugin you're using |
Current behavior:
We're using cordova-plugin-local-notifications and cordova-plugin-firebasex plugins in our ionic 3 project. When iOS app is in foreground and scheduled local notification should appear it throws
error "FirebasePlugin[native]: willPresentNotification: aborting as not a supported UNNotificationTrigger" instead
I've created minimal ionic 3 project here https://github.com/AndrewBargan/firebasexAndLocalNotificationsBug
Take a look at src/pages/home/home.ts for code that causes problem.
Expected behavior:
Subscription handlers to both firebasex and local notificaitons work simultaneously.
Steps to reproduce:
When app from repository mentioned above built and installed on a real device:
In 3 seconds error is thrown to console:
"FirebasePlugin[native]: willPresentNotification: aborting as not a supported UNNotificationTrigger"
To reproduce this bug again you need to remove platform and add plugins once again and rebuild the project. For this:
Keep in mind you have to put valid GoogleService-Info.plist into the root of the project to make app work.
Environment information
Cordova CLI version
- 9.0.0 ([email protected])
Cordova platform version
ios 5.0.1
Available platforms:
android ^8.0.0
browser ^6.0.0
electron ^1.0.0
osx ^5.0.0
windows ^7.0.0
Plugins & versions installed in project
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebasex 7.0.1 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
Dev machine: macOS 10.15.1
Device details: iPhone SE, iOS 13.2.2
XCode v11.2.1
BTW: Found issue that looks similar: #95
If it is maybe a good idea to pull from fork of this plugin with the fix that Fabricio Garcia did to the current one.
The text was updated successfully, but these errors were encountered: