react-native-navigation with react-native-sentry ios



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

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

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

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

感谢您的帮助

> 在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]];

你应该能够使用 installWithBridge。

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

最新更新