react-native-navigation的迁移库

RNNEventEmitter.m 478B

123456789101112131415161718192021222324252627
  1. #import "RNNEventEmitter.h"
  2. #import "RNN.h"
  3. @implementation RNNEventEmitter
  4. RCT_EXPORT_MODULE();
  5. static NSString* const onAppLaunched = @"onAppLaunched";
  6. -(NSArray<NSString *> *)supportedEvents
  7. {
  8. return @[onAppLaunched];
  9. }
  10. +(void)sendOnAppLaunched
  11. {
  12. [RNNEventEmitter send:onAppLaunched body:nil];
  13. }
  14. +(void)send:(NSString *)eventName body:(id)body
  15. {
  16. [[RNN.instance.bridge moduleForClass:[RNNEventEmitter class]] sendEventWithName:eventName body:body];
  17. }
  18. @end