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 with other react-native modules (other libs using RCTDeviceEventEmitter with same event names) #54

Closed
rcugut opened this issue Nov 22, 2022 · 0 comments · Fixed by #70

Comments

@rcugut
Copy link

rcugut commented Nov 22, 2022

The event name(s) emitted by the native module to JS are too generic and they conflict with other libs that emit the same event names.

My specific problem (conflict) is with Agora RTC react-native which uses a single event named "onEvent".

The React Native code says:

Currently, all native events are fired via a global RCTDeviceEventEmitter.
This means event names must be globally unique, and it means that call sites
can theoretically listen to RCTDeviceEventEmitter (although discouraged).

But I guess it's quite appealing for lib authors to call the event name onEvent :-)

A simple solution would be to just prefix all the event names with pusher: and update the JS to delegate with this prefix behind the scenes.

I'll fork and update the code with this change, since I'm blocked in my project by this issue.
And I'll get back with a PR, in case it's worth merging back in the master here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant