mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Update NativeModulesIOS.md
This commit is contained in:
@@ -178,6 +178,11 @@ The native module can signal events to JavaScript without being invoked directly
|
|||||||
|
|
||||||
```objective-c
|
```objective-c
|
||||||
#import "RCTBridge.h"
|
#import "RCTBridge.h"
|
||||||
|
#import "RCTEventDispatcher.h"
|
||||||
|
|
||||||
|
@implementation CalendarManager
|
||||||
|
|
||||||
|
@synthesize bridge = _bridge;
|
||||||
|
|
||||||
- (void)calendarEventReminderReceived:(NSNotification *)notification
|
- (void)calendarEventReminderReceived:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
@@ -185,6 +190,8 @@ The native module can signal events to JavaScript without being invoked directly
|
|||||||
[self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder"
|
[self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder"
|
||||||
body:@{@"name": eventName}];
|
body:@{@"name": eventName}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
```
|
```
|
||||||
|
|
||||||
JavaScript code can subscribe to these events:
|
JavaScript code can subscribe to these events:
|
||||||
|
|||||||
Reference in New Issue
Block a user