为了将Sentry与CocoaPods一起使用,您必须使用npm或yarn安装包,并在Podfile中本地链接它们。
npm install --save react react-native react-native-sentry
yarn add react react-native react-native-sentry
之后,将Podfile更改为引用node_modules文件夹中的包。有关如何与CocoaPods一起使用react-native的最新参考,请参阅React Native官方文档。
target 'YOUR-TARGET' do
# Your react-native and other pods
pod 'SentryReactNative', :path => '../node_modules/react-native-sentry/SentryReactNative.podspec' # or your path to node_modules
end
之后运行pod install然后应该正确链接所有内容。请记住,您需要上传源地图和调试符号的构建步骤。