question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conflict between nativescript-local-notifications and nativescript-plugin-firebase on iOS

See original GitHub issue

I was using version 3.0.0 of nativescript-local-notifications with nativescript-push-notifications and, as far as the limitations of that other plugin allow, everything was working fine on iOS.

However, after replacing it with nativescript-plugin-firebase, it’s not possible to schedule and display a local notification anymore:

Step by step, this is what’s happening:

  • nativescript-plugin-firebase receives a remote push notification and calls the onMessageReceivedCallback with the following Message (as long as the application is on the foreground, even thought the Push Notifications Capability is enabled):

    {
        "adb_deeplink": "...",
        "message": "...",
        "attachment-url": "...",
        "from": "...",
        "foreground": true,
        "data": {
            "adb_deeplink": "...",
            "message": "...",
            "attachment-url": "...",
            "from": "...",
            "foreground": true
        }
    }
    
  • nativescript-push-notifications schedules a local notification using that data with no at set and forceShowWhenInForeground: true and the following message appears on the console:

    CONSOLE LOG file:///app/tns_modules/nativescript-plugin-firebase/messaging
    /messaging.js:463:20: >>>>>>>>>>> Handle push from foreground
    
  • onMessageReceivedCallback from nativescript-plugin-firebase is invoked again with the following Message:

    {
        "forceShowWhenInForeground": true,
        "foreground": true,
        "data": {
            "forceShowWhenInForeground": true,
            "foreground":true
        }
    }
    

If the App is in background, onMessageReceivedCallback won’t be called until the App is opened, but then the same whole thing happens.

Tested on an iPhone 7 with iOS 10.3.1.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:26 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
EddyVerbruggencommented, Sep 17, 2018

Man, you’re kicking a$$, looks good to me! Perhaps remove the package.json version bump from your PR (I can ignore it, no biggie). I will release 7.0.0 soon and I’d love to include this.

1reaction
EddyVerbruggencommented, Sep 10, 2018

To eaily test it, you could change https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/d0f3f3d478b3e3a121d36be4c61cee7e738df7a0/src/messaging/messaging.ios.ts#L529 to if (1 === 1) in your node_modules folder. If that helps I can add the change I proposed in my previous comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nativescript. nativescript-local-notifications always creates two ...
I use nativescript-local-notifications and nativescript-plugin-firebase. I want to create notification each time, when server send me a message.
Read more >
Firebase Apple SDK Release Notes - Google
Added notification support for iOS 16 simulators on Xcode 14. ... a crash that occurred when integrating Firebase In-App Messaging into NativeScript apps....
Read more >
Local Notifications - NativeScript Docs
The Local Notifications plugin allows your app to show notifications when the app is not running. Just like remote push notifications, but a...
Read more >
Handle Google Play Services Conflicts In NativeScript Mobile ...
Learn about handling conflicts in NativeScript plugins for Android that use Google Play Services such as Firebase Cloud Messaging or ...
Read more >
[Solved]-Beacon With Local Notification - appsloveworld.com
How to auto increment iOS notification badge with Firebase Cloud Messaging? ... How can I remove previously delivered notifications when a new notification ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found