Skip to content

Question - is there support for the new RN architecture? #1040

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

Open
eldadts opened this issue Jun 2, 2024 · 7 comments
Open

Question - is there support for the new RN architecture? #1040

eldadts opened this issue Jun 2, 2024 · 7 comments

Comments

@eldadts
Copy link

eldadts commented Jun 2, 2024

No description provided.

@Yandamuri
Copy link

I am ready to migrate to this package if it supports new architecture

@van8tka
Copy link

van8tka commented Jan 20, 2025

ios worked perfecty on new arch but android it's pain not only arch pain

@itsmeshusha
Copy link

when there will be support for the new architecture?

@bananer
Copy link

bananer commented Feb 19, 2025

For me, none of the registration callbacks are called on android with the new architecture.

Opting out for now https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out

@digitalthjarta
Copy link

Opting out on Android fixed this for me as well. Wish that was in the documentation. Spent way too much time troubleshooting this. Wish I found this post first thing.

@Sky
Copy link

Sky commented Apr 3, 2025

For me, none of the registration callbacks are called on android with the new architecture.

Opting out for now https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out

Same issue on Android. Looks like this package is not supported for a long time already

@Sky
Copy link

Sky commented Apr 4, 2025

Here is the patch which fixes registration events delivery from native to JS on Android but I did not tested notifications yet

diff --git a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/fcm/FcmToken.java b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/fcm/FcmToken.java
index 7db6e8d..050cf00 100644
--- a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/fcm/FcmToken.java
+++ b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/fcm/FcmToken.java
@@ -5,10 +5,11 @@ import android.os.Bundle;
 import android.util.Log;
 
 import com.facebook.react.ReactApplication;
-import com.facebook.react.ReactInstanceManager;
 import com.facebook.react.bridge.ReactContext;
 import com.google.firebase.messaging.FirebaseMessaging;
 import com.wix.reactnativenotifications.BuildConfig;
+import com.wix.reactnativenotifications.core.AppLifecycleFacade;
+import com.wix.reactnativenotifications.core.AppLifecycleFacadeHolder;
 import com.wix.reactnativenotifications.core.JsIOHelper;
 
 import static com.wix.reactnativenotifications.Defs.LOGTAG;
@@ -88,8 +89,8 @@ public class FcmToken implements IFcmToken {
     }
 
     protected void sendTokenToJS() {
-        final ReactInstanceManager instanceManager = ((ReactApplication) mAppContext).getReactNativeHost().getReactInstanceManager();
-        final ReactContext reactContext = instanceManager.getCurrentReactContext();
+        AppLifecycleFacade facade = AppLifecycleFacadeHolder.get();
+        final ReactContext reactContext = facade.getRunningReactContext();
 
         // Note: Cannot assume react-context exists cause this is an async dispatched service.
         if (reactContext != null && reactContext.hasActiveCatalystInstance()) {

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

7 participants