目前用"react-native-navigation": "2.0.0-experimental.304"
运行"react-native-sentry": "^0.8.1"
在react-native-navigation的设置中,它要求用户修改AppDelegate.m
看起来更像这个example用RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation...
替换[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
由于我不再引用rootView
,我无法将其传递给哨兵设置方法[RNSentry installWithRootView:rootView];
我怎样才能访问原来的rootView (RCTRootView)
所以我可以将它传递给Sentry?
谢谢您的帮助
您应该能够使用installWithBridge。
[RNSentry installWithBridge:[[RCCManager sharedInstance] getBridge]];
在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]];