在facebook的文档中它说
- (void)calendarEventReminderReceived:(NSNotification *)notification
{
NSString *eventName = notification.userInfo[@"name"];
[self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder"
body:@{@"name": eventName}];
}
JavaScript 代码可以订阅这些事件:
var subscription = DeviceEventEmitter.addListener(
'EventReminder',
(reminder) => console.log(reminder.name)
);
但我永远无法得到这份工作。这应该是 sendDeviceEventWithName 吗?本机模块也应该始终是单例的吗?