当前正在运行 "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 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/