相关疑难解决方法(0)

在Swift中将本机发送事件发送到JavaScript

如何在Swift中将事件发送到JavaScript?

有一些Objc代码示例如何将事件发送到JavaScript,但我需要在swift中做什么?

#import "RCTBridge.h"
#import "RCTEventDispatcher.h"

@implementation CalendarManager

@synthesize bridge = _bridge;

- (void)calendarEventReminderReceived:(NSNotification *)notification
{
  NSString *eventName = notification.userInfo[@"name"];
  [self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder"
                                               body:@{@"name": eventName}];
}

@end
Run Code Online (Sandbox Code Playgroud)

swift react-native

6
推荐指数
1
解决办法
3348
查看次数

标签 统计

react-native ×1

swift ×1