voxeet / voxeet-uxkit-reactnative

https://www.npmjs.com/package/@voxeet/react-native-voxeet-conferencekit
MIT License
11 stars 12 forks source link

[Android] Native Events are not emitted to JS #6

Closed AlexanderPodlesniyQs closed 3 years ago

AlexanderPodlesniyQs commented 4 years ago

Native Events are not emitted to JS on Android

After some research I've found 3 issues preventing event emitting.

  1. RNVoxeetConferencekitPackage doesn't export RNVoxeetConferenceEventModule.
  2. ConferenceStatusEventEmitter class doesn't have @Subscribe decorators for onEvent functions (ConferenceUserEventEmitter class has it).
  3. AbstractEventEmitter class in emit function throws "InvocationTargetException: Map already consumed" exception. There are two events shoud be emitted, but because of this exception nothing it emitted.

I found solutions for all three above reasons. Maybe they are not best. 1, 2 are quite obvious: add module to export and add @Subscribe decorators.

  1. I've add replaced map object usage with map.copy()

context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(callback.name(), map.copy());

After these changes DeviceEventEmitter started to receive Voxeet events.

codlab commented 4 years ago

This is not a bug, it's a feature meant to be released for a future version of the library 👍

jchang0419 commented 3 years ago

@codlab was this ever added?

codlab commented 3 years ago

Closing this rather old ticket since it's now officially supported, almost every events are available. If some are missing (or will come but aren't yet), please open a new ticket 👍