react-native-navigation的迁移库

RNNEventEmitter.m 788B

12345678910111213141516171819202122232425262728293031323334353637
  1. #import "RNNEventEmitter.h"
  2. @implementation RNNEventEmitter
  3. RCT_EXPORT_MODULE();
  4. static NSString* const onAppLaunched = @"RNN.appLaunched";
  5. static NSString* const containerStart = @"RNN.containerStart";
  6. static NSString* const containerStop = @"RNN.containerStop";
  7. -(NSArray<NSString *> *)supportedEvents {
  8. return @[onAppLaunched, containerStart, containerStop];
  9. }
  10. # pragma mark public
  11. -(void)sendOnAppLaunched {
  12. [self send:onAppLaunched body:nil];
  13. }
  14. -(void)sendContainerStart:(NSString *)containerId {
  15. [self send:containerStart body:containerId];
  16. }
  17. -(void)sendContainerStop:(NSString *)containerId {
  18. [self send:containerStop body:containerId];
  19. }
  20. # pragma mark private
  21. -(void)send:(NSString *)eventName body:(id)body {
  22. [self sendEventWithName:eventName body:body];
  23. }
  24. @end