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.

Actions do not work on fresh install due to conflict with the cordova-plugin-firebase

See original GitHub issue

Provide a general summary of the issue.

Your Environment

  • Plugin version: 0.9.0-beta1
  • Platform: iOS
  • OS version: iOS 10.3.3
  • Device manufacturer / model: iPhone 6S
  • Cordova version (cordova -v): 7.1.0
  • Cordova platform version (cordova platform ls): ios 4.4.0
  • Plugin config None
  • Ionic Version (if using Ionic) Not using it

Expected Behavior

Action always works.

Actual Behavior

Action doesn’t work if app is first installed.

Steps to Reproduce

  1. Install app
  2. Send a notification with action
  3. Notification appears, action button appears
  4. Touch the button and nothing happened.

Context

Actually I already know what is going on. This plugin is in conflict with cordova-plugin-firebase at least version 0.1.24. Both are trying to be delegate for UNUserNotificationCenter. But only one can be at a time. Launching with a fresh install, perhaps I let Firebase ask for permission first, and this plugin lose the delegate status for UNUserNotificationCenter. Subsequent launches do ensure this plugin is the delegate.

This is actually a tricky issue. I don’t know what should really be done in this case. Maybe two plugin should actually be a single plugin?

Debug logs

None necessary.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
katzercommented, Feb 12, 2018

I hope this change might help to improve the situation where multiple classes would like to listen for the same delegate. https://github.com/katzer/cordova-plugin-local-notifications/commit/641ff31a67236fd1db5add911d8fae2047552925

1reaction
t2wucommented, Dec 12, 2017

For the moment since I only uses actions for local notifications, I changed APPLocalNotification.m so that it will always reclaim as the delegate when scheduling a notification event. Obviously this is not really satisfactory but it works for my purpose.

- (void) schedule:(CDVInvokedUrlCommand*)command
{
    NSArray* notifications = command.arguments;

    // Add the following hack:
    UNUserNotificationCenter.currentNotificationCenter.delegate = self;

    . . .
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to install 'cordova-plugin-firebase': Error: Uh oh
I am trying to install the cordova-plugin-firebase in my ionic app but it's not working I have cordova-android version 9.1.0 When I try...
Read more >
cordova-plugin-firebasex-with-upstream-messaging - Snyk
Your Android build may fail if you are installing multiple plugins that use the Google Play Services library. This is caused by plugins...
Read more >
Authenticate Using OAuth Providers with Cordova - Firebase
In the Firebase console, open the Auth section. On the Sign in method tab, enable the Google sign-in method and click Save. Install...
Read more >
Blog - Apache Cordova
By passing down all attribute data, Cordova-Common no longer needs to be updated for adding and supporting new platform attributes. Please ...
Read more >
cordova-plugin-firebasex - npm
The Firebase Inapp Messaging SDK component has been removed from this cli_build branch of the plugin due to the iOS component causing CLI...
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