com.facebook.react.modules.core.RCTNativeAppEventEmitter Java Examples

The following examples show how to use com.facebook.react.modules.core.RCTNativeAppEventEmitter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseReactPackage.java    From react-native-workers with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
    return Arrays.asList(
            DeviceEventManagerModule.RCTDeviceEventEmitter.class,
            JSTimersExecution.class,
            RCTEventEmitter.class,
            RCTNativeAppEventEmitter.class,
            com.facebook.react.bridge.Systrace.class,
            JSCHeapCapture.HeapCapture.class
    );
}
 
Example #2
Source File: NativeAdManager.java    From react-native-fbads with MIT License 5 votes vote down vote up
/**
 * Helper for sending events back to Javascript.
 *
 * @param eventName
 * @param params
 */
private void sendAppEvent(String eventName, Object params) {
  ReactApplicationContext context = this.getReactApplicationContext();

  if (context == null || !context.hasActiveCatalystInstance()) {
    return;
  }

  context
      .getJSModule(RCTNativeAppEventEmitter.class)
      .emit(eventName, params);
}
 
Example #3
Source File: BleManager.java    From react-native-ble-manager with Apache License 2.0 4 votes vote down vote up
public void sendEvent(String eventName, @Nullable WritableMap params) {
	getReactApplicationContext().getJSModule(RCTNativeAppEventEmitter.class).emit(eventName, params);
}
 
Example #4
Source File: Peripheral.java    From react-native-ble-manager with Apache License 2.0 4 votes vote down vote up
private void sendEvent(String eventName, @Nullable WritableMap params) {
	reactContext.getJSModule(RCTNativeAppEventEmitter.class).emit(eventName, params);
}