Skip to content
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

Conflict zo0r/react-native-push-notification and @aws-amplify/pushnotification #893

Closed
ththugues44 opened this issue Oct 8, 2018 · 12 comments

Comments

@ththugues44
Copy link

ththugues44 commented Oct 8, 2018

Hello

I do not know how to do it because I have a conflict of package namely:
i am using @aws-amplify/pushnotification for remote push notifications and i want to use zo0r / react-native-push-notification for local notifications and badge. Here is the problem :

in the MainApllication.java file for the @ aws-amplify / pushnotification package we need to include importing this import com.amazonaws.amplify.pushnotification.RNPushNotificationPackage and add new RNPushNotificationPackage (). for the zo0r / react-native-push-notification package we need to import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage and add ReactNativePushNotificationPackage.

I have an error NATIVE model RNPushNotification tried to override RNPushNotificationModule for Mofule name RNPushNotification if this was your intention, set canOverrideExistingModule = true. (See photos ) => http://www.noelshack.com/2018-41-1-1539003383-conflict-package.jpeg

i think there is a conflict between @ aws-amplify / pushnotification and zo0r / react-native-push-notification, please how do I resolve this conflict because i need local notifications and badges for my application?

Source Code File File MainApllication.java
` package com.katika;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.android.freshchatSdk.FreshChatReactPackage;
import com.amazonaws.amplify.pushnotification.RNPushNotificationPackage;
import com.robinpowered.react.Intercom.IntercomPackage;
import io.intercom.android.sdk.Intercom;
import com.masteratul.RNAppstoreVersionCheckerPackage;
import io.xogus.reactnative.versioncheck.RNVersionCheckPackage;
import com.microsoft.codepush.react.CodePush;
import io.invertase.firebase.RNFirebasePackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import io.underscope.react.fbak.RNAccountKitPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import io.underscope.react.fbak.RNAccountKitPackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
import io.invertase.firebase.functions.RNFirebaseFunctionsPackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage; // <-- Add this line
import io.invertase.firebase.crash.RNFirebaseCrashPackage; // <-- Add this line
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage; // <-- Add this lin.util.Arrays;e
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage ; // <--- Import Package

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {

    @Override
    protected String getJSBundleFile() {
    return CodePush.getJSBundleFile();
    }

@Override
public boolean getUseDeveloperSupport() {
  return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new VectorIconsPackage(),
        new FreshChatReactPackage(),
        new RNPushNotificationPackage(),
        new IntercomPackage(),
        new RNAppstoreVersionCheckerPackage(),
        new RNVersionCheckPackage(),
        new CodePush("bySq16a9P0d2pIdf9ZZvyaRJbzcOSJ8Sg7bHX", getApplicationContext(), BuildConfig.DEBUG),
        new RNFirebasePackage(),
        new BackgroundTimerPackage(),
        new RNAccountKitPackage(),
        new RNFirebaseAnalyticsPackage(),
        new RNFirebaseNotificationsPackage(),
        new RNFirebaseFunctionsPackage(),
        new RNFirebaseMessagingPackage(),
        new RNFirebaseCrashlyticsPackage(),
        new RNFirebaseFirestorePackage(),
        new RNFirebaseCrashPackage(),
        new ReactNativePushNotificationPackage () // <-- Add this line
  );
}

@Override
protected String getJSMainModuleName() {
  return "index";
}

};

@OverRide
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@OverRide
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
Intercom.initialize(this, "android_sdk-83be2abcbbe01abc199897d691de1c8b47f703d3", "tduveiqw");
}

}
`

@bernhardt1
Copy link

hey @noellaby did you manage to resolve this?

I'm in the same situation. I want to use aws-amplify push notifications for the remote sending of notifications along with the react-native-push-notification package for displaying local notifications and badges.

I'm thinking this is a very difficult issue and likely not worth solving since these two packages conflict with each other in so many ways.

How did you proceed?

@GraemeAllanBryce
Copy link

I too have the same issue

@Kamill90
Copy link

Any solution here? I have same issue with react native 0.60

@bneigher
Copy link

+1

1 similar comment
@FortisFortuna
Copy link

+1

@FortisFortuna
Copy link

FortisFortuna commented May 17, 2020

I ended up using
Notifications.postLocalNotification({ ... }) in
https://github.com/wix/react-native-notifications
after aws-amplify recieved the remote.

@rjuevesano
Copy link

Encountered the same issue.

I ended up using
Notifications.postLocalNotification({ ... }) in
https://github.com/wix/react-native-notifications
after aws-amplify recieved the remote.

I tried that but the scheduling won't work on android.

@Dallas62
Copy link
Collaborator

@Dallas62
Copy link
Collaborator

You can also use the full namespace to avoid import.

@rjuevesano
Copy link

You can also use the full namespace to avoid import.

Can you give an example on how to do that?

@Dallas62
Copy link
Collaborator

Oh ! I saw the issue, it's not a Java issue, it's in the package naming. I will look into it.

@Dallas62 Dallas62 pinned this issue Oct 21, 2020
@usmansbk
Copy link

usmansbk commented Nov 5, 2020

Ended up using react-native-onesignal for remote notifications

@Dallas62 Dallas62 closed this as completed Jan 5, 2021
@Dallas62 Dallas62 unpinned this issue Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants