ios - react native 导航与 react native Sentry ios

标签 ios react-native sentry react-native-navigation

当前正在运行 "react-native-navigation": "2.0.0-experimental.304""react-native-sentry": "^0.8.1"

在react-native-navigation的设置中,它要求用户修改AppDelegate.m,使其看起来更像这样exampleRCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation... 替换为 [[RCCManager shareInstance] initBridgeWithBundleURL:jsCodeLocation];

由于我不再引用 rootView,我无法将其传递给 Sentry 设置方法 [RNSentry installWithRootView:rootView];

如何访问原始 rootView (RCTRootView) 以便将其传递给 Sentry?

感谢您的帮助

最佳答案

react-native-navigation v1 中,您可以使用下面的代码代替 [RNSentry installWithRootView:rootView];:

[RNSentry installWithBridge:[[RCCManager sharedInstance] getBridge]];

但是在 react-native-navigation v2 中,RCCManager 文件已被删除,为了集成 react-native-sentry 您可以使用此代码,在 AppDelegate.m 文件中,而不是 [RNSentry installWithRootView:rootView];

[RNSentry installWithBridge:[ReactNativeNavigation getBridge]];

关于ios - react native 导航与 react native Sentry ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43932332/

相关文章:

ios - 自定义输入 View 执行。除非打开默认键盘,否则自定义 inputView 不会出现

javascript - React Native Jest 测试 : TypeError: Cannot read property 'unsubscribeFromTopic' of undefined

sublimetext3 - 崇高的文字语法着色报价问题

Django Sentry 在开发环境中报错

flutter - 如何通过 Sentry 发送设备信息

iphone - UIActionSheet 不是为按钮索引加载操作吗?

ios - 如何在左侧的垂直轴上显示标签(使用图表)?

objective-c - 如何从另一个类访问 xib 中的 UIPicker?

javascript - 我正在创建一个带有 react-native-elements 的复选框列表。我如何一次只选中一个框?

java - Sentry JVM 选项占位符