title: How to receive event callbacks using RCTEventEmitter in react-native
body: <p>After updating react-native code from 0.28 to 0.30, subclassing <code>RCTEventEmitter</code> is the recommended way for sending events back to Javascript and the old way is deprecated. </p>
  
  <pre><code>- (void)startObserving{}
  
  - (void)stopObserving{}
  
  - (NSArray&lt;NSString *&gt; *)supportedEvents{
  
      return @[@"someInterestingEvent"];
  }
  
  -(void)interestingEventHappen{
      [self sendEventWithName:@"someInterestingEvent" body:nil];
  }
  </code></pre>
  
  <p>The problem is how do I receive the callback rather than just registering the event. I notice <code>RCTEventEmitter</code> has method <code>RCT_EXPORT_METHOD(addListener:(NSString *)eventName)</code> exposed, but it only receives one argument(the event name). I tried the document:</p>
  
  <p><code>NativeAppEventEmitter.addListener('someInterestingEvent', ()=&gt;{});</code></p>
  
  <p>with no results and the yellow box complaines sending <code>someInterestingEvent</code> with no listeners registered.</p>
  
  <p>Did I miss something? </p>