Просмотр исходного кода

iOS native event fix (#3254)

As you can see here: https://github.com/wix/react-native-navigation/blob/v2/lib/src/events/EventsRegistry.ts#L28 nativeEventListener expects an object which is includes name and params but on the iOS side, the native bridge is triggers the event listener but passes wrong object. iOS is passes commandName instead of name. This commit is fixes the problem.
Yusuf YILDIRIM 6 лет назад
Родитель
Сommit
7661d4b579
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      lib/ios/RNNEventEmitter.m

+ 2
- 2
lib/ios/RNNEventEmitter.m Просмотреть файл

@@ -40,11 +40,11 @@ static NSString* const navigationEvent	= @"RNN.nativeEvent";
40 40
 }
41 41
 
42 42
 -(void)sendOnNavigationCommand:(NSString *)commandName params:(NSDictionary*)params {
43
-	[self send:navigationEvent body:@{@"commandName":commandName , @"params": params}];
43
+	[self send:navigationEvent body:@{@"name":commandName , @"params": params}];
44 44
 }
45 45
 
46 46
 -(void)sendOnNavigationEvent:(NSString *)commandName params:(NSDictionary*)params {
47
-	[self send:navigationEvent body:@{@"commandName":commandName , @"params": params}];
47
+	[self send:navigationEvent body:@{@"name":commandName , @"params": params}];
48 48
 }
49 49
 
50 50
 - (void)addListener:(NSString *)eventName {