本文整理匯總了TypeScript中react-native-sentry.Sentry.config方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Sentry.config方法的具體用法?TypeScript Sentry.config怎麽用?TypeScript Sentry.config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類react-native-sentry.Sentry
的用法示例。
在下文中一共展示了Sentry.config方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
import { Sentry } from 'react-native-sentry';
import CodePush from 'react-native-code-push';
import config from 'config';
if (!__DEV__ && config.SENTRY_DSN) {
// Install sentry
Sentry.config(config.SENTRY_DSN).install();
// Set Sentry CodePush metadata
CodePush.getUpdateMetadata()
.then((update) => {
if (update) {
Sentry.setVersion(`${update.appVersion}-codepush:${update.label}`);
}
});
}
示例2:
import { NativeModules } from "react-native"
const { Emission } = NativeModules
import { Sentry } from "react-native-sentry"
// AREmission sets this to "" if not configured, which is falsy in JS so this conditional is fine.
if (Emission.sentryDSN) {
Sentry.config(Emission.sentryDSN).install()
}