Cordova-plugin-local-notifications: Conflict with cordova-plugin-firebase

Created on 26 Jan 2018  路  7Comments  路  Source: katzer/cordova-plugin-local-notifications

Hi,

Like this issue (https://github.com/katzer/cordova-plugin-local-notifications/issues/1492)
I have a conflict with another plugin. I created another issue because it's with another plugin. But I think this is connected.

Your Environment

  • Plugin version: 0.9-beta2
  • Platform: iOS
  • OS version: 11
  • Device manufacturer / model:
  • Cordova version : 7.0.1
  • Cordova platform version :
    Installed platforms:
    browser 5.0.3
    ios 4.5.4
    Available platforms:
    android ~6.2.2
    blackberry10 ~3.8.0 (deprecated)
    osx ~4.0.1
    webos ~3.7.0
  • Plugin config
  • Ionic Version (if using Ionic) v1

Expected Behavior

cordova-plugin-local-notifications and cordova-plugin-firebase worked together.
When app is in foreground, local notifications should be display when cordova-plugin-firebase is calling.

Actual Behavior

Conflict between this two plugins.

Steps to Reproduce

step-1 : try

if (cordova.platformId == 'ios') {
               //window.FirebasePlugin.grantPermission();
            }

            cordova.plugins.notification.local.schedule({
                title: "pouet",
                text: "pouet",
                foreground: true
            });

step-2: uncomment the line

if (cordova.platformId == 'ios') {
               window.FirebasePlugin.grantPermission();
            }

            cordova.plugins.notification.local.schedule({
                title: "pouet",
                text: "pouet",
                foreground: true
            });

Like this issue : https://github.com/katzer/cordova-plugin-local-notifications/issues/1492

If i tried

window.FirebasePlugin.onNotificationOpen(function (notif) {
                        console.log('notif:received',notif);
                        if(notif.tap){
                            listener.next(notif);
                        }else{
                            cordova.plugins.notification.local.schedule({
                                title: notif.title,
                                text: notif.body,
                                data: notif,
                                foreground: true
                            });

                        }
                        listener.next(notif);
                    }, function (error) {
                        listener.error(error);
                    });    

The local notification is not display yet.

If cordova-plugin-local-notifications push a notification, firebase notifications not yet pushed.

Most helpful comment

All 7 comments

Same problem here

I have the same behaviour!

The same problem with fcm-plugin.
Ok, I can use v0.8.5, but it鈥檚 not work on android 8.

... very bad situation

Anybody managed to solve this?

My build doesn't work when I combine these two plugins:

What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

Any suggestion?
Thanks

Was this page helpful?
0 / 5 - 0 ratings