AppCenter 代码的反演- Native 监视
设置
此软件包是用于 react-native-code-push 图书馆。 在使用之前, 安装和设置核心 mobile-react-native SDK(英语:SDK).
要安装国家预防机制,运行:
npm install @datadog/mobile-react-native-code-push
要安装 Yarn, 请运行 :
yarn add @datadog/mobile-react-native-code-push
初始化 SDK
为 RUM 初始化 Datadog React 原始 SDK, 使用 DatadogCodepush.initialize 改为 DdSdkReactNative.initialize数字 :
import { DdSdkReactNativeConfiguration } from '@datadog/mobile-react-native';
import { DatadogCodepush } from '@datadog/mobile-react-native-code-push';
const config = new DdSdkReactNativeConfiguration(
'<CLIENT_TOKEN>',
'<ENVIRONMENT_NAME>',
'<RUM_APPLICATION_ID>',
true, // track user interactions (such as a tap on buttons). You can use the 'accessibilityLabel' element property to give the tap action a name, otherwise the element type is reported
true, // track XHR resources
true // track errors
);
await DatadogCodepush.initialize(config);
此方法将您报告的版本设定为与该版本相同的值 datadog-ci react-native codepush 命令 用于上传代码组合和源地图.
备选案文 @datadog/mobile-react-native-code-push
如果您使用 datadog-ci react-native upload 要上传版本格式不同的代码Push捆绑和源代码映射,您可以通过使用任意一种方法来覆盖SDK配置对象中报告的版本:
versionSuffix(建议)在您的应用程序的商业版本中添加后缀version以完全覆盖版本