Fix duplicate method name conflict in Kotlin module for new RN architecture #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR resolves TurboModule compatibility issues with React Native 0.72+ by renaming all overloaded native methods to have unique names. This prevents runtime crashes caused by duplicate method names in the new architecture.
Details:
Renamed all overloaded native methods (e.g., logEvent(eventName, vars) → logEventWithVars(eventName, vars), setGeoIPTrackingEnabled(enabled, promise) → setGeoIPTrackingEnabledWithPromise(enabled, promise), etc.) on both Android and iOS.
Updated all JS usage and examples to use the new method names.
No functional changes: the renamed methods work exactly as before, just with unique names to satisfy TurboModule requirements.
This change is required for compatibility with React Native 0.72+ and Expo SDK 53+.
Why:
React Native’s new TurboModule system does not allow multiple native methods with the same name, even if their parameters differ. This PR ensures the SDK works with the latest React Native versions and avoids runtime crashes.
Impact: