-
Notifications
You must be signed in to change notification settings - Fork 25k
Description
There is an issue with the tutorial, with the sendAppEventWithName call.
From: https://facebook.github.io/react-native/docs/nativemodulesios.html
This example code will fail with this problem:
Text for search engine: "Requiring unknown module "RCTNativeAppEventEmitter". If you are sure the modules is there, try restarting the packager.
This is because this call...
| [_bridge enqueueJSCall:@"RCTNativeAppEventEmitter.emit" |
Will eventually hit this line, where the error occurs, because there is no RCTNativeAppEventEmitter in the dependency tree. I guess this is because the JavaScript in the example is using the DeviceEventEmitter which is actually requiring the RCTDeviceEventEmitter, not the RCTAppEventEmitter which I cannot find anywhere in the JS code?
Changing the example Objective-C to call sendDeviceEventWithName instead of sendAppEventWithName fixes the problem.

