使用react-native-sentry ios进行本地导航

问题描述 投票:1回答:2

目前用"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 sharedInstance] initBridgeWithBundleURL:jsCodeLocation];

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

我怎样才能访问原来的rootView (RCTRootView)所以我可以将它传递给Sentry?

谢谢您的帮助

ios react-native sentry react-native-navigation
2个回答
1
投票

您应该能够使用installWithBridge。

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

1
投票

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]];
© www.soinside.com 2019 - 2024. All rights reserved.