@microsoft/applicationinsights-react-native 2.5.0-beta.2203-16 → 2.5.0-nightly.2204-05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-react-native.js +259 -357
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +2 -2
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.api.json +20 -11
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +259 -357
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +2 -2
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativePlugin.js +5 -5
- package/dist-esm/ReactNativePlugin.js.map +1 -1
- package/dist-esm/index.js +1 -1
- package/package.json +4 -4
- package/src/ReactNativePlugin.ts +7 -6
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-nightly.2204-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @copyright Microsoft 2019
|
|
8
8
|
*/
|
|
9
9
|
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
10
|
-
import {
|
|
11
|
-
arrForEach, dumpObj, getExceptionName, isObject, hasOwnProperty, isUndefined } from "@microsoft/applicationinsights-core-js";
|
|
10
|
+
import { BaseTelemetryPlugin, //,
|
|
11
|
+
arrForEach, dumpObj, getExceptionName, isObject, hasOwnProperty, isUndefined, _throwInternal, _warnToConsole } from "@microsoft/applicationinsights-core-js";
|
|
12
12
|
import { ConfigurationManager, SeverityLevel, AnalyticsPluginIdentifier } from "@microsoft/applicationinsights-common";
|
|
13
13
|
import DeviceInfo from "react-native-device-info";
|
|
14
14
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
@@ -89,7 +89,7 @@ var ReactNativePlugin = /** @class */ (function (_super) {
|
|
|
89
89
|
_device.model = DeviceInfo.getModel();
|
|
90
90
|
}
|
|
91
91
|
catch (e) {
|
|
92
|
-
_self.diagLog()
|
|
92
|
+
_warnToConsole(_self.diagLog(), "Failed to get DeviceInfo: " + getExceptionName(e) + " - " + dumpObj(e));
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
_self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {
|
|
@@ -144,7 +144,7 @@ var ReactNativePlugin = /** @class */ (function (_super) {
|
|
|
144
144
|
_analyticsPlugin.trackException(exception);
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
|
-
_self.diagLog()
|
|
147
|
+
_throwInternal(_self.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, "Analytics plugin is not available, ReactNative plugin telemetry will not be sent: ");
|
|
148
148
|
}
|
|
149
149
|
// call the _defaultHandler - react native also gets the error
|
|
150
150
|
if (_defaultHandler) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativePlugin.js.map","sources":["ReactNativePlugin.js"],"sourcesContent":["/**\r\n * ReactNativePlugin.ts\r\n * @copyright Microsoft 2019\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, //,\r\narrForEach, dumpObj, getExceptionName, isObject, hasOwnProperty, isUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ConfigurationManager, SeverityLevel, AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport DeviceInfo from \"react-native-device-info\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { getGlobal, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a\r\n * performance optimization to avoid the creation of a new array for large objects\r\n * @param target The target object to find and process the keys\r\n * @param callbackfn The function to call with the details\r\n */\r\nexport function objForEachKey(target, callbackfn) {\r\n if (target && isObject(target)) {\r\n for (var prop in target) {\r\n if (hasOwnProperty(target, prop)) {\r\n callbackfn.call(target, prop, target[prop]);\r\n }\r\n }\r\n }\r\n}\r\nvar ReactNativePlugin = /** @class */ (function (_super) {\r\n __extends(ReactNativePlugin, _super);\r\n function ReactNativePlugin(config) {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"AppInsightsReactNativePlugin\";\r\n _this.priority = 140;\r\n // Automatic defaults, don't set values here only set in _initDefaults()\r\n var _device;\r\n var _config;\r\n var _analyticsPlugin;\r\n var _defaultHandler;\r\n dynamicProto(ReactNativePlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, // need `| object` to coerce to interface\r\n core, extensions) {\r\n if (!_self.isInitialized()) {\r\n _base.initialize(config, core, extensions);\r\n var inConfig_1 = config || {};\r\n var defaultConfig = _getDefaultConfig();\r\n objForEachKey(defaultConfig, function (option, value) {\r\n _config[option] = ConfigurationManager.getConfig(inConfig_1, option, _self.identifier, !isUndefined(_config[option]) ? _config[option] : value);\r\n });\r\n if (!_config.disableDeviceCollection) {\r\n _self._collectDeviceInfo();\r\n }\r\n if (extensions) {\r\n arrForEach(extensions, function (ext) {\r\n var identifier = ext.identifier;\r\n if (identifier === AnalyticsPluginIdentifier) {\r\n _analyticsPlugin = ext;\r\n }\r\n });\r\n }\r\n if (!_config.disableExceptionCollection) {\r\n _self._setExceptionHandler();\r\n }\r\n }\r\n };\r\n _self.processTelemetry = function (item, itemCtx) {\r\n _applyDeviceContext(item);\r\n _self.processNext(item, itemCtx);\r\n };\r\n _self.setDeviceId = function (newId) {\r\n _device.id = newId;\r\n };\r\n _self.setDeviceModel = function (newModel) {\r\n _device.model = newModel;\r\n };\r\n _self.setDeviceType = function (newType) {\r\n _device.deviceClass = newType;\r\n };\r\n /**\r\n * Automatically collects native device info for this device\r\n */\r\n _self._collectDeviceInfo = function () {\r\n try {\r\n _device.deviceClass = DeviceInfo.getDeviceType();\r\n _device.id = DeviceInfo.getUniqueId(); // Installation ID\r\n _device.model = DeviceInfo.getModel();\r\n }\r\n catch (e) {\r\n _self.diagLog().warnToConsole(\"Failed to get DeviceInfo: \" + getExceptionName(e) + \" - \" + dumpObj(e));\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {\r\n _resetGlobalErrorHandler();\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _device = {};\r\n _config = config || _getDefaultConfig();\r\n _analyticsPlugin = null;\r\n _defaultHandler = null;\r\n }\r\n function _applyDeviceContext(item) {\r\n if (_device) {\r\n item.ext = item.ext || {};\r\n item.ext.device = item.ext.device || {};\r\n if (typeof _device.id === \"string\") {\r\n item.ext.device.localId = _device.id;\r\n }\r\n if (typeof _device.model === \"string\") {\r\n item.ext.device.model = _device.model;\r\n }\r\n if (typeof _device.deviceClass === \"string\") {\r\n item.ext.device.deviceClass = _device.deviceClass;\r\n }\r\n }\r\n }\r\n function _getGlobal() {\r\n if (typeof global !== strShimUndefined && global) {\r\n return global;\r\n }\r\n return getGlobal();\r\n }\r\n _self._setExceptionHandler = function () {\r\n var _global = _getGlobal();\r\n if (_global && _global.ErrorUtils) {\r\n // intercept react-native error handling\r\n _defaultHandler = (typeof _global.ErrorUtils.getGlobalHandler === \"function\" && _global.ErrorUtils.getGlobalHandler()) || _global.ErrorUtils._globalHandler;\r\n _global.ErrorUtils.setGlobalHandler(_trackException);\r\n }\r\n };\r\n function _resetGlobalErrorHandler() {\r\n var _global = _getGlobal();\r\n if (_global && _global.ErrorUtils && _global.ErrorUtils.getGlobalHandler() === _trackException) {\r\n _global.ErrorUtils.setGlobalHandler(_defaultHandler || null);\r\n }\r\n }\r\n // default global error handler syntax: handleError(e, isFatal)\r\n function _trackException(e, isFatal) {\r\n var exception = { exception: e, severityLevel: SeverityLevel.Error };\r\n if (_analyticsPlugin) {\r\n _analyticsPlugin.trackException(exception);\r\n }\r\n else {\r\n _self.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: \");\r\n }\r\n // call the _defaultHandler - react native also gets the error\r\n if (_defaultHandler) {\r\n _defaultHandler.call(global, e, isFatal);\r\n }\r\n }\r\n // Test Hooks\r\n _self._config = _config;\r\n _self._getDbgPlgTargets = function () {\r\n return [_device];\r\n };\r\n });\r\n function _getDefaultConfig() {\r\n return {\r\n // enable auto collection by default\r\n disableDeviceCollection: false,\r\n disableExceptionCollection: false\r\n };\r\n }\r\n return _this;\r\n }\r\n ReactNativePlugin.prototype.initialize = function (config, // need `| object` to coerce to interface\r\n core, extensions) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceId = function (newId) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceModel = function (newModel) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceType = function (newType) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return ReactNativePlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { ReactNativePlugin };\r\n//# sourceMappingURL=ReactNativePlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;8DAeM;AACN;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"ReactNativePlugin.js.map","sources":["ReactNativePlugin.js"],"sourcesContent":["/**\r\n * ReactNativePlugin.ts\r\n * @copyright Microsoft 2019\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { BaseTelemetryPlugin, //,\r\narrForEach, dumpObj, getExceptionName, isObject, hasOwnProperty, isUndefined, _throwInternal, _warnToConsole } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ConfigurationManager, SeverityLevel, AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport DeviceInfo from \"react-native-device-info\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { getGlobal, strShimUndefined } from \"@microsoft/applicationinsights-shims\";\r\n/**\r\n * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a\r\n * performance optimization to avoid the creation of a new array for large objects\r\n * @param target The target object to find and process the keys\r\n * @param callbackfn The function to call with the details\r\n */\r\nexport function objForEachKey(target, callbackfn) {\r\n if (target && isObject(target)) {\r\n for (var prop in target) {\r\n if (hasOwnProperty(target, prop)) {\r\n callbackfn.call(target, prop, target[prop]);\r\n }\r\n }\r\n }\r\n}\r\nvar ReactNativePlugin = /** @class */ (function (_super) {\r\n __extends(ReactNativePlugin, _super);\r\n function ReactNativePlugin(config) {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"AppInsightsReactNativePlugin\";\r\n _this.priority = 140;\r\n // Automatic defaults, don't set values here only set in _initDefaults()\r\n var _device;\r\n var _config;\r\n var _analyticsPlugin;\r\n var _defaultHandler;\r\n dynamicProto(ReactNativePlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, // need `| object` to coerce to interface\r\n core, extensions) {\r\n if (!_self.isInitialized()) {\r\n _base.initialize(config, core, extensions);\r\n var inConfig_1 = config || {};\r\n var defaultConfig = _getDefaultConfig();\r\n objForEachKey(defaultConfig, function (option, value) {\r\n _config[option] = ConfigurationManager.getConfig(inConfig_1, option, _self.identifier, !isUndefined(_config[option]) ? _config[option] : value);\r\n });\r\n if (!_config.disableDeviceCollection) {\r\n _self._collectDeviceInfo();\r\n }\r\n if (extensions) {\r\n arrForEach(extensions, function (ext) {\r\n var identifier = ext.identifier;\r\n if (identifier === AnalyticsPluginIdentifier) {\r\n _analyticsPlugin = ext;\r\n }\r\n });\r\n }\r\n if (!_config.disableExceptionCollection) {\r\n _self._setExceptionHandler();\r\n }\r\n }\r\n };\r\n _self.processTelemetry = function (item, itemCtx) {\r\n _applyDeviceContext(item);\r\n _self.processNext(item, itemCtx);\r\n };\r\n _self.setDeviceId = function (newId) {\r\n _device.id = newId;\r\n };\r\n _self.setDeviceModel = function (newModel) {\r\n _device.model = newModel;\r\n };\r\n _self.setDeviceType = function (newType) {\r\n _device.deviceClass = newType;\r\n };\r\n /**\r\n * Automatically collects native device info for this device\r\n */\r\n _self._collectDeviceInfo = function () {\r\n try {\r\n _device.deviceClass = DeviceInfo.getDeviceType();\r\n _device.id = DeviceInfo.getUniqueId(); // Installation ID\r\n _device.model = DeviceInfo.getModel();\r\n }\r\n catch (e) {\r\n _warnToConsole(_self.diagLog(), \"Failed to get DeviceInfo: \" + getExceptionName(e) + \" - \" + dumpObj(e));\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {\r\n _resetGlobalErrorHandler();\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _device = {};\r\n _config = config || _getDefaultConfig();\r\n _analyticsPlugin = null;\r\n _defaultHandler = null;\r\n }\r\n function _applyDeviceContext(item) {\r\n if (_device) {\r\n item.ext = item.ext || {};\r\n item.ext.device = item.ext.device || {};\r\n if (typeof _device.id === \"string\") {\r\n item.ext.device.localId = _device.id;\r\n }\r\n if (typeof _device.model === \"string\") {\r\n item.ext.device.model = _device.model;\r\n }\r\n if (typeof _device.deviceClass === \"string\") {\r\n item.ext.device.deviceClass = _device.deviceClass;\r\n }\r\n }\r\n }\r\n function _getGlobal() {\r\n if (typeof global !== strShimUndefined && global) {\r\n return global;\r\n }\r\n return getGlobal();\r\n }\r\n _self._setExceptionHandler = function () {\r\n var _global = _getGlobal();\r\n if (_global && _global.ErrorUtils) {\r\n // intercept react-native error handling\r\n _defaultHandler = (typeof _global.ErrorUtils.getGlobalHandler === \"function\" && _global.ErrorUtils.getGlobalHandler()) || _global.ErrorUtils._globalHandler;\r\n _global.ErrorUtils.setGlobalHandler(_trackException);\r\n }\r\n };\r\n function _resetGlobalErrorHandler() {\r\n var _global = _getGlobal();\r\n if (_global && _global.ErrorUtils && _global.ErrorUtils.getGlobalHandler() === _trackException) {\r\n _global.ErrorUtils.setGlobalHandler(_defaultHandler || null);\r\n }\r\n }\r\n // default global error handler syntax: handleError(e, isFatal)\r\n function _trackException(e, isFatal) {\r\n var exception = { exception: e, severityLevel: SeverityLevel.Error };\r\n if (_analyticsPlugin) {\r\n _analyticsPlugin.trackException(exception);\r\n }\r\n else {\r\n _throwInternal(_self.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, \"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: \");\r\n }\r\n // call the _defaultHandler - react native also gets the error\r\n if (_defaultHandler) {\r\n _defaultHandler.call(global, e, isFatal);\r\n }\r\n }\r\n // Test Hooks\r\n _self._config = _config;\r\n _self._getDbgPlgTargets = function () {\r\n return [_device];\r\n };\r\n });\r\n function _getDefaultConfig() {\r\n return {\r\n // enable auto collection by default\r\n disableDeviceCollection: false,\r\n disableExceptionCollection: false\r\n };\r\n }\r\n return _this;\r\n }\r\n ReactNativePlugin.prototype.initialize = function (config, // need `| object` to coerce to interface\r\n core, extensions) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceId = function (newId) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceModel = function (newModel) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ReactNativePlugin.prototype.setDeviceType = function (newType) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return ReactNativePlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { ReactNativePlugin };\r\n//# sourceMappingURL=ReactNativePlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;8DAeM;AACN;AACA;AACA;AACA"}
|
package/dist-esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-nightly.2204-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { ReactNativePlugin } from "./ReactNativePlugin";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-react-native",
|
|
3
|
-
"version": "2.5.0-
|
|
3
|
+
"version": "2.5.0-nightly.2204-05",
|
|
4
4
|
"description": "Microsoft Application Insights React Native Plugin",
|
|
5
5
|
"main": "dist-esm/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"uglify-js": "^3.11.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@microsoft/applicationinsights-common": "2.8.0-
|
|
57
|
-
"@microsoft/applicationinsights-core-js": "2.8.0-
|
|
56
|
+
"@microsoft/applicationinsights-common": "2.8.0-nightly.2204-05",
|
|
57
|
+
"@microsoft/applicationinsights-core-js": "2.8.0-nightly.2204-05",
|
|
58
58
|
"@microsoft/applicationinsights-shims": "2.0.1",
|
|
59
59
|
"@microsoft/dynamicproto-js": "^1.1.4"
|
|
60
60
|
},
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
},
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"publishConfig": {
|
|
68
|
-
"tag": "
|
|
68
|
+
"tag": "nightly"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/ReactNativePlugin.ts
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
ITelemetryItem,
|
|
9
9
|
IPlugin,
|
|
10
10
|
IAppInsightsCore,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
eLoggingSeverity,
|
|
12
|
+
_eInternalMessageId,
|
|
13
13
|
BaseTelemetryPlugin,
|
|
14
14
|
IProcessTelemetryContext,//,
|
|
15
15
|
arrForEach,
|
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
hasOwnProperty,
|
|
20
20
|
isUndefined,
|
|
21
21
|
IProcessTelemetryUnloadContext,
|
|
22
|
-
ITelemetryUnloadState
|
|
22
|
+
ITelemetryUnloadState,
|
|
23
|
+
_throwInternal, _warnToConsole
|
|
23
24
|
} from "@microsoft/applicationinsights-core-js";
|
|
24
25
|
import { ConfigurationManager, IDevice, IExceptionTelemetry, IAppInsights, SeverityLevel, AnalyticsPluginIdentifier } from "@microsoft/applicationinsights-common";
|
|
25
26
|
import DeviceInfo from "react-native-device-info";
|
|
@@ -131,7 +132,7 @@ export class ReactNativePlugin extends BaseTelemetryPlugin {
|
|
|
131
132
|
_device.id = DeviceInfo.getUniqueId(); // Installation ID
|
|
132
133
|
_device.model = DeviceInfo.getModel();
|
|
133
134
|
} catch (e) {
|
|
134
|
-
_self.diagLog()
|
|
135
|
+
_warnToConsole(_self.diagLog(), "Failed to get DeviceInfo: " + getExceptionName(e) + " - " + dumpObj(e));
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -194,8 +195,8 @@ export class ReactNativePlugin extends BaseTelemetryPlugin {
|
|
|
194
195
|
if (_analyticsPlugin) {
|
|
195
196
|
_analyticsPlugin.trackException(exception);
|
|
196
197
|
} else {
|
|
197
|
-
_self.diagLog()
|
|
198
|
-
|
|
198
|
+
_throwInternal(_self.diagLog(),
|
|
199
|
+
eLoggingSeverity.CRITICAL, _eInternalMessageId.TelemetryInitializerFailed, "Analytics plugin is not available, ReactNative plugin telemetry will not be sent: ");
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
// call the _defaultHandler - react native also gets the error
|