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

Not compatible with react-native 0.76 #602

Open
dwxw opened this issue Nov 14, 2024 · 5 comments
Open

Not compatible with react-native 0.76 #602

dwxw opened this issue Nov 14, 2024 · 5 comments
Assignees

Comments

@dwxw
Copy link

dwxw commented Nov 14, 2024

After upgrading to react-native 0.76, on Android I see the following runtime error:

(NOBRIDGE) ERROR Error: Exception in HostObject::get for prop 'RNIterableAPI': com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotations from native module: RNIterableAPI. Details: Module exports two methods to JavaScript with the same name: "setEmail
(NOBRIDGE) WARN Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'Iterable' of undefined

@behnamazimi
Copy link

Is there a roadmap for when the SDK will become compatible with the new RN version?

@jnleonard3
Copy link

We were able to resolve this in the meantime by utilizing yarn patch to remove the single argument methods:

diff --git a/android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java b/android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java
index 0f55031aac67cdabbef42a496981d87ee4c7dbf9..6ac8fdbaebf842407a8758c3146fcad8d07b9a8b 100644
--- a/android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java
+++ b/android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java
@@ -106,13 +106,6 @@ public class RNIterableAPIModule extends ReactContextBaseJavaModule implements I
         promise.resolve(true);
     }

-    @ReactMethod
-    public void setEmail(@Nullable String email) {
-        IterableLogger.d(TAG, "setEmail: " + email);
-        
-        IterableApi.getInstance().setEmail(email);
-    }
-
     @ReactMethod
     public void setEmail(@Nullable String email, @Nullable String authToken) {
         IterableLogger.d(TAG, "setEmail: " + email + " authToken: " + authToken);
@@ -120,13 +113,6 @@ public class RNIterableAPIModule extends ReactContextBaseJavaModule implements I
         IterableApi.getInstance().setEmail(email, authToken);
     }

-    @ReactMethod
-    public void updateEmail(String email) {
-        IterableLogger.d(TAG, "updateEmail: " + email);
-
-        IterableApi.getInstance().updateEmail(email);
-    }
-
     @ReactMethod
     public void updateEmail(String email, @Nullable String authToken) {
         IterableLogger.d(TAG, "updateEmail: " + email + " authToken: " + authToken);
@@ -145,12 +131,6 @@ public class RNIterableAPIModule extends ReactContextBaseJavaModule implements I
         callback.invoke("Received numberArgument: " + numberArgument + " stringArgument: " + stringArgument);
     }

-    @ReactMethod
-    public void setUserId(@Nullable String userId) {
-        IterableLogger.d(TAG, "setUserId: " + userId);
-        IterableApi.getInstance().setUserId(userId);
-    }
-
     @ReactMethod
     public void setUserId(@Nullable String userId, @Nullable String authToken) {
         IterableLogger.d(TAG, "setUserId: " + userId + " authToken: " + authToken);

@bhandanyan-nomad
Copy link

bhandanyan-nomad commented Feb 21, 2025

Anyone from Iterable able to comment on this? @evantk91 perhaps? RN is now on 0.78 so this feels overdue

@santomegonzalo
Copy link

santomegonzalo commented Feb 28, 2025

I ended up doing the same as @jnleonard3 ! thanks for the advice!..

Iterable! come on you should fix this!

@lposen
Copy link
Contributor

lposen commented Feb 28, 2025

Hi all. We've released a beta on master which incorporates an update to RN 0.75.3. Upgrading to this version should fix the issue.

NOTE: As this is a beta release, there is a higher likelihood that you may encounter issues. We suggest updating in a sandbox environment first.

If your team is interested in partnering on current or upcoming Iterable RN SDK priorities (including this beta), please contact your CSM!

@lposen lposen self-assigned this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants