@react-native-firebase/crashlytics 23.6.0 → 23.8.0
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/dist/commonjs/handlers.js +175 -0
- package/dist/commonjs/handlers.js.map +1 -0
- package/dist/commonjs/index.js +38 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/modular.js +256 -0
- package/dist/commonjs/modular.js.map +1 -0
- package/dist/commonjs/namespaced.js +138 -0
- package/dist/commonjs/namespaced.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/types/crashlytics.js +47 -0
- package/dist/commonjs/types/crashlytics.js.map +1 -0
- package/dist/commonjs/version.js +9 -0
- package/dist/commonjs/version.js.map +1 -0
- package/{lib → dist/module}/handlers.js +39 -36
- package/dist/module/handlers.js.map +1 -0
- package/{ios/RNFBCrashlytics/RNFBCrashlyticsModule.h → dist/module/index.js} +10 -6
- package/dist/module/index.js.map +1 -0
- package/{lib/modular/index.js → dist/module/modular.js} +37 -43
- package/dist/module/modular.js.map +1 -0
- package/dist/module/namespaced.js +135 -0
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types/crashlytics.js +43 -0
- package/dist/module/types/crashlytics.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/typescript/commonjs/lib/handlers.d.ts +28 -0
- package/dist/typescript/commonjs/lib/handlers.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/index.d.ts +5 -0
- package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
- package/{lib/modular/index.d.ts → dist/typescript/commonjs/lib/modular.d.ts} +37 -40
- package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts +12 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/types/crashlytics.d.ts +117 -0
- package/dist/typescript/commonjs/lib/types/crashlytics.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/version.d.ts +2 -0
- package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/module/lib/handlers.d.ts +28 -0
- package/dist/typescript/module/lib/handlers.d.ts.map +1 -0
- package/dist/typescript/module/lib/index.d.ts +5 -0
- package/dist/typescript/module/lib/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/modular.d.ts +193 -0
- package/dist/typescript/module/lib/modular.d.ts.map +1 -0
- package/dist/typescript/module/lib/namespaced.d.ts +12 -0
- package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/module/lib/types/crashlytics.d.ts +117 -0
- package/dist/typescript/module/lib/types/crashlytics.d.ts.map +1 -0
- package/dist/typescript/module/lib/version.d.ts +2 -0
- package/dist/typescript/module/lib/version.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/lib/handlers.ts +196 -0
- package/{ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h → lib/index.ts} +8 -11
- package/lib/modular.ts +249 -0
- package/lib/{index.js → namespaced.ts} +51 -22
- package/lib/types/crashlytics.ts +159 -0
- package/lib/version.ts +2 -0
- package/package.json +60 -8
- package/tsconfig.json +21 -0
- package/CHANGELOG.md +0 -1132
- package/RNFBCrashlytics.podspec +0 -54
- package/android/.editorconfig +0 -10
- package/android/build.gradle +0 -102
- package/android/lint.xml +0 -5
- package/android/settings.gradle +0 -1
- package/android/src/main/AndroidManifest.xml +0 -15
- package/android/src/main/java/io/invertase/firebase/crashlytics/Constants.java +0 -29
- package/android/src/main/java/io/invertase/firebase/crashlytics/JavaScriptError.java +0 -28
- package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsInitProvider.java +0 -130
- package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsModule.java +0 -223
- package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsNativeHelper.java +0 -18
- package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsPackage.java +0 -41
- package/android/src/main/java/io/invertase/firebase/crashlytics/UnhandledPromiseRejection.java +0 -28
- package/app.plugin.js +0 -1
- package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h +0 -33
- package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m +0 -142
- package/ios/RNFBCrashlytics/RNFBCrashlyticsModule.m +0 -248
- package/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m +0 -36
- package/ios/RNFBCrashlytics.xcodeproj/project.pbxproj +0 -359
- package/ios/RNFBCrashlytics.xcodeproj/xcshareddata/IDETemplateMacros.plist +0 -24
- package/ios_config.sh +0 -25
- package/lib/index.d.ts +0 -287
- package/lib/version.js +0 -2
- package/plugin/build/android/applyPlugin.d.ts +0 -6
- package/plugin/build/android/applyPlugin.js +0 -28
- package/plugin/build/android/buildscriptDependency.d.ts +0 -6
- package/plugin/build/android/buildscriptDependency.js +0 -29
- package/plugin/build/android/constants.d.ts +0 -3
- package/plugin/build/android/constants.js +0 -7
- package/plugin/build/android/index.d.ts +0 -3
- package/plugin/build/android/index.js +0 -7
- package/plugin/build/index.d.ts +0 -3
- package/plugin/build/index.js +0 -12
- package/plugin/tsconfig.tsbuildinfo +0 -1
- package/react-native.config.js +0 -35
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FATAL_FLAG = void 0;
|
|
7
|
+
exports.createNativeErrorObj = createNativeErrorObj;
|
|
8
|
+
exports.setOnUnhandledPromiseRejectionHandler = exports.setGlobalErrorHandler = void 0;
|
|
9
|
+
var _index = require("./index.js");
|
|
10
|
+
var _common = require("@react-native-firebase/app/lib/common");
|
|
11
|
+
var _rejectionTracking = _interopRequireDefault(require("promise/setimmediate/rejection-tracking"));
|
|
12
|
+
var _stacktraceJs = _interopRequireDefault(require("stacktrace-js"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/*
|
|
15
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this library except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
// @ts-ignore - No declaration file for promise/setimmediate/rejection-tracking
|
|
32
|
+
|
|
33
|
+
const FATAL_FLAG = exports.FATAL_FLAG = 'com.firebase.crashlytics.reactnative.fatal';
|
|
34
|
+
function createNativeErrorObj(error, stackFrames, isUnhandledRejection, jsErrorName) {
|
|
35
|
+
const nativeObj = {
|
|
36
|
+
message: `${error.message}`,
|
|
37
|
+
isUnhandledRejection,
|
|
38
|
+
frames: []
|
|
39
|
+
};
|
|
40
|
+
if (jsErrorName) {
|
|
41
|
+
// Option to fix crashlytics display and alerting. You can add an error name to the recordError function
|
|
42
|
+
nativeObj.frames.push({
|
|
43
|
+
src: '<unknown>',
|
|
44
|
+
line: 0,
|
|
45
|
+
col: 0,
|
|
46
|
+
fn: '<unknown>',
|
|
47
|
+
file: jsErrorName
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
for (let i = 0; i < stackFrames.length; i++) {
|
|
51
|
+
const frame = stackFrames[i];
|
|
52
|
+
if (!frame) continue;
|
|
53
|
+
const {
|
|
54
|
+
columnNumber,
|
|
55
|
+
lineNumber,
|
|
56
|
+
fileName,
|
|
57
|
+
functionName,
|
|
58
|
+
source
|
|
59
|
+
} = frame;
|
|
60
|
+
let fileNameParsed = '<unknown>';
|
|
61
|
+
if (fileName) {
|
|
62
|
+
const subStrLen = fileName.indexOf('?');
|
|
63
|
+
if (subStrLen < 0) {
|
|
64
|
+
fileNameParsed = fileName;
|
|
65
|
+
} else if (subStrLen > 0) {
|
|
66
|
+
fileNameParsed = fileName.substring(0, subStrLen);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
nativeObj.frames.push({
|
|
70
|
+
src: source || '<unknown>',
|
|
71
|
+
line: lineNumber || 0,
|
|
72
|
+
col: columnNumber || 0,
|
|
73
|
+
fn: functionName || '<unknown>',
|
|
74
|
+
file: `${fileNameParsed}:${lineNumber || 0}:${columnNumber || 0}`
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return nativeObj;
|
|
78
|
+
}
|
|
79
|
+
const setGlobalErrorHandler = exports.setGlobalErrorHandler = (0, _common.once)(nativeModule => {
|
|
80
|
+
const originalHandler = ErrorUtils.getGlobalHandler();
|
|
81
|
+
async function handler(error, fatal) {
|
|
82
|
+
// If collection is disabled, just forward to the original handler
|
|
83
|
+
if (!nativeModule.isCrashlyticsCollectionEnabled) {
|
|
84
|
+
return originalHandler(error, fatal);
|
|
85
|
+
}
|
|
86
|
+
if (!(0, _common.isError)(error)) {
|
|
87
|
+
await nativeModule.logPromise(`Unknown Error: ${error}`);
|
|
88
|
+
return originalHandler(error, fatal);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// If we are supposed to log javascript-level stack traces, convert this error and log it
|
|
92
|
+
if (nativeModule.isErrorGenerationOnJSCrashEnabled) {
|
|
93
|
+
try {
|
|
94
|
+
const stackFrames = await _stacktraceJs.default.fromError(error, {
|
|
95
|
+
offline: true
|
|
96
|
+
});
|
|
97
|
+
// The backend conversion scan converts the closest event to this timestamp without going over
|
|
98
|
+
// from the timestamp here. So the timestamp *must* be greater then the event log time.
|
|
99
|
+
//
|
|
100
|
+
// For that reason we always round up (`.ceil`) and add a second in case of latency
|
|
101
|
+
//
|
|
102
|
+
// Time is specified as seconds since start of Unix epoch as a baseline, as a string
|
|
103
|
+
const fatalTime = Math.ceil(new Date().getTime() / 1000) + 1 + '';
|
|
104
|
+
|
|
105
|
+
// Flag the Crashlytics backend that we have a fatal error, they will transform it
|
|
106
|
+
await nativeModule.setAttribute(FATAL_FLAG, fatalTime);
|
|
107
|
+
|
|
108
|
+
// remember our current deprecation warning state in case users
|
|
109
|
+
// have set it to non-default
|
|
110
|
+
const currentDeprecationWarningToggle = globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS;
|
|
111
|
+
|
|
112
|
+
// Notify analytics, if it exists - throws error if not
|
|
113
|
+
try {
|
|
114
|
+
// FIXME - disable warnings and use the old namespaced style,
|
|
115
|
+
// See https://github.com/invertase/react-native-firebase/issues/8381
|
|
116
|
+
// Unfortunately, this fails completely when using modular!
|
|
117
|
+
// Did not matter if I did named imports above or dynamic require here.
|
|
118
|
+
// So temporarily reverting and silencing warnings instead
|
|
119
|
+
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = true;
|
|
120
|
+
// @ts-ignore - analytics types not available in crashlytics
|
|
121
|
+
await _index.firebase.app().analytics().logEvent('app_exception',
|
|
122
|
+
// 'app_exception' is reserved but we make an exception for JS->fatal transforms
|
|
123
|
+
{
|
|
124
|
+
fatal: 1,
|
|
125
|
+
// as in firebase-android-sdk
|
|
126
|
+
timestamp: fatalTime
|
|
127
|
+
});
|
|
128
|
+
} catch (_) {
|
|
129
|
+
// This just means analytics was not present, so we could not log the analytics event
|
|
130
|
+
// console.log('error logging analytics app_exception: ' + e);
|
|
131
|
+
} finally {
|
|
132
|
+
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = currentDeprecationWarningToggle;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// If we are chaining to other handlers, just record the error, otherwise we need to crash with it
|
|
136
|
+
if (nativeModule.isCrashlyticsJavascriptExceptionHandlerChainingEnabled) {
|
|
137
|
+
await nativeModule.recordErrorPromise(createNativeErrorObj(error, stackFrames, false));
|
|
138
|
+
} else {
|
|
139
|
+
await nativeModule.crashWithStackPromise(createNativeErrorObj(error, stackFrames, false));
|
|
140
|
+
}
|
|
141
|
+
} catch (_) {
|
|
142
|
+
// do nothing
|
|
143
|
+
// console.log('error logging handling the exception: ' + e);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// If we are configured to chain exception handlers, do so. It could result in duplicate errors though.
|
|
148
|
+
if (nativeModule.isCrashlyticsJavascriptExceptionHandlerChainingEnabled) {
|
|
149
|
+
return originalHandler(error, fatal);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
ErrorUtils.setGlobalHandler(handler);
|
|
153
|
+
return handler;
|
|
154
|
+
});
|
|
155
|
+
const setOnUnhandledPromiseRejectionHandler = exports.setOnUnhandledPromiseRejectionHandler = (0, _common.once)(nativeModule => {
|
|
156
|
+
async function onUnhandled(_id, error) {
|
|
157
|
+
if (!__DEV__) {
|
|
158
|
+
// TODO(salakar): Option to disable
|
|
159
|
+
try {
|
|
160
|
+
const stackFrames = await _stacktraceJs.default.fromError(error, {
|
|
161
|
+
offline: true
|
|
162
|
+
});
|
|
163
|
+
await nativeModule.recordErrorPromise(createNativeErrorObj(error, stackFrames, true));
|
|
164
|
+
} catch (_) {
|
|
165
|
+
// do nothing
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_rejectionTracking.default.enable({
|
|
170
|
+
allRejections: true,
|
|
171
|
+
onUnhandled
|
|
172
|
+
});
|
|
173
|
+
return onUnhandled;
|
|
174
|
+
});
|
|
175
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","_common","_rejectionTracking","_interopRequireDefault","_stacktraceJs","e","__esModule","default","FATAL_FLAG","exports","createNativeErrorObj","error","stackFrames","isUnhandledRejection","jsErrorName","nativeObj","message","frames","push","src","line","col","fn","file","i","length","frame","columnNumber","lineNumber","fileName","functionName","source","fileNameParsed","subStrLen","indexOf","substring","setGlobalErrorHandler","once","nativeModule","originalHandler","ErrorUtils","getGlobalHandler","handler","fatal","isCrashlyticsCollectionEnabled","isError","logPromise","isErrorGenerationOnJSCrashEnabled","StackTrace","fromError","offline","fatalTime","Math","ceil","Date","getTime","setAttribute","currentDeprecationWarningToggle","globalThis","RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS","firebase","app","analytics","logEvent","timestamp","_","isCrashlyticsJavascriptExceptionHandlerChainingEnabled","recordErrorPromise","crashWithStackPromise","setGlobalHandler","setOnUnhandledPromiseRejectionHandler","onUnhandled","_id","__DEV__","tracking","enable","allRejections"],"sourceRoot":"../../lib","sources":["handlers.ts"],"mappings":";;;;;;;;AAiBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAuC,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AArBvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAGO,MAAMG,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,4CAA4C;AA0B/D,SAASE,oBAAoBA,CAClCC,KAAY,EACZC,WAAoC,EACpCC,oBAA6B,EAC7BC,WAAoB,EACJ;EAChB,MAAMC,SAAyB,GAAG;IAChCC,OAAO,EAAE,GAAGL,KAAK,CAACK,OAAO,EAAE;IAC3BH,oBAAoB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
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _namespaced.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _modular = require("./modular.js");
|
|
14
|
+
Object.keys(_modular).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _modular[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _modular[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
var _namespaced = _interopRequireWildcard(require("./namespaced.js"));
|
|
26
|
+
Object.keys(_namespaced).forEach(function (key) {
|
|
27
|
+
if (key === "default" || key === "__esModule") return;
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
+
if (key in exports && exports[key] === _namespaced[key]) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _namespaced[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_modular","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_namespaced","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor"],"sourceRoot":"../../lib","sources":["index.ts"],"mappings":";;;;;;;;;;;;AAqBA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAS,WAAA,GAAAC,uBAAA,CAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,WAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,WAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,WAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAA6B,SAAAU,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAT,GAAA,CAAAG,CAAA,GAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAV,cAAA,CAAAC,IAAA,CAAAQ,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAApB,MAAA,CAAAS,cAAA,KAAAT,MAAA,CAAA2B,wBAAA,CAAAb,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAK,GAAA,IAAAN,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkForUnsentReports = checkForUnsentReports;
|
|
7
|
+
exports.crash = crash;
|
|
8
|
+
exports.deleteUnsentReports = deleteUnsentReports;
|
|
9
|
+
exports.didCrashOnPreviousExecution = didCrashOnPreviousExecution;
|
|
10
|
+
exports.getCrashlytics = getCrashlytics;
|
|
11
|
+
exports.log = log;
|
|
12
|
+
exports.recordError = recordError;
|
|
13
|
+
exports.sendUnsentReports = sendUnsentReports;
|
|
14
|
+
exports.setAttribute = setAttribute;
|
|
15
|
+
exports.setAttributes = setAttributes;
|
|
16
|
+
exports.setCrashlyticsCollectionEnabled = setCrashlyticsCollectionEnabled;
|
|
17
|
+
exports.setUserId = setUserId;
|
|
18
|
+
var _app = require("@react-native-firebase/app");
|
|
19
|
+
var _common = require("@react-native-firebase/app/lib/common");
|
|
20
|
+
/**
|
|
21
|
+
* Returns Crashlytics instance.
|
|
22
|
+
* #### Example
|
|
23
|
+
* ```js
|
|
24
|
+
* const crashlytics = getCrashlytics();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function getCrashlytics() {
|
|
28
|
+
return (0, _app.getApp)().crashlytics();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
|
|
33
|
+
* if automatic data collection is disabled.
|
|
34
|
+
*
|
|
35
|
+
* #### Example
|
|
36
|
+
*
|
|
37
|
+
* ```js
|
|
38
|
+
* async checkReports() {
|
|
39
|
+
* // returns boolean value
|
|
40
|
+
* const crashlytics = getCrashlytics();
|
|
41
|
+
* const unsentReports = await checkForUnsentReports(crashlytics);
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* checkReports();
|
|
45
|
+
* ```
|
|
46
|
+
* @param crashlytics A crashlytics instance.
|
|
47
|
+
* @returns Promise that resolves to a boolean indicating if there are unsent reports.
|
|
48
|
+
*/
|
|
49
|
+
function checkForUnsentReports(crashlytics) {
|
|
50
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
51
|
+
return crashlytics.checkForUnsentReports.call(crashlytics, _common.MODULAR_DEPRECATION_ARG);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Deletes any unsent reports on the device. This method only applies if automatic data collection is
|
|
56
|
+
* disabled.
|
|
57
|
+
*
|
|
58
|
+
* #### Example
|
|
59
|
+
*
|
|
60
|
+
* ```js
|
|
61
|
+
* const crashlytics = getCrashlytics();
|
|
62
|
+
* deleteUnsentReports(crashlytics);
|
|
63
|
+
* ```
|
|
64
|
+
* @param crashlytics A crashlytics instance.
|
|
65
|
+
*/
|
|
66
|
+
function deleteUnsentReports(crashlytics) {
|
|
67
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
68
|
+
return crashlytics.deleteUnsentReports.call(crashlytics, _common.MODULAR_DEPRECATION_ARG);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns a boolean value indicating whether the app crashed during the previous execution.
|
|
73
|
+
*
|
|
74
|
+
* #### Example
|
|
75
|
+
*
|
|
76
|
+
* ```js
|
|
77
|
+
* async didCrashPreviously() {
|
|
78
|
+
* // returns boolean value
|
|
79
|
+
* const crashlytics = getCrashlytics();
|
|
80
|
+
* const didCrash = await didCrashOnPreviousExecution(crashlytics);
|
|
81
|
+
* }
|
|
82
|
+
*
|
|
83
|
+
* didCrashPreviously();
|
|
84
|
+
* ```
|
|
85
|
+
* @param crashlytics A crashlytics instance.
|
|
86
|
+
* @returns Promise that resolves to a boolean indicating if the app crashed previously.
|
|
87
|
+
*/
|
|
88
|
+
function didCrashOnPreviousExecution(crashlytics) {
|
|
89
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
90
|
+
return crashlytics.didCrashOnPreviousExecution.call(crashlytics, _common.MODULAR_DEPRECATION_ARG);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Cause your app to crash for testing purposes. This is a native crash and will not contain a javascript stack trace.
|
|
95
|
+
* Note that crashes are intercepted by debuggers on iOS so no report will be seen under those conditions. Additionally
|
|
96
|
+
* if it is a debug build you will need to ensure your firebase.json is configured to enable crashlytics even in debug mode.
|
|
97
|
+
*
|
|
98
|
+
* #### Example
|
|
99
|
+
*
|
|
100
|
+
* ```js
|
|
101
|
+
* const crashlytics = getCrashlytics();
|
|
102
|
+
* crash(crashlytics);
|
|
103
|
+
* ```
|
|
104
|
+
* @param crashlytics A crashlytics instance.
|
|
105
|
+
*/
|
|
106
|
+
function crash(crashlytics) {
|
|
107
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
108
|
+
return crashlytics.crash.call(crashlytics, _common.MODULAR_DEPRECATION_ARG);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Log a message that will appear in any subsequent Crash or Non-fatal error reports.
|
|
113
|
+
*
|
|
114
|
+
* #### Example
|
|
115
|
+
*
|
|
116
|
+
* ```js
|
|
117
|
+
* const crashlytics = getCrashlytics();
|
|
118
|
+
* log(crashlytics, 'Testing a crash');
|
|
119
|
+
* crash(crashlytics);
|
|
120
|
+
* ```
|
|
121
|
+
* @param crashlytics A crashlytics instance.
|
|
122
|
+
* @param message The message to log.
|
|
123
|
+
*/
|
|
124
|
+
function log(crashlytics, message) {
|
|
125
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
126
|
+
return crashlytics.log.call(crashlytics, message, _common.MODULAR_DEPRECATION_ARG);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Record a JavaScript Error.
|
|
131
|
+
*
|
|
132
|
+
* The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.
|
|
133
|
+
* The line numbers in the stack trace (if available) will be relative to the javascript bundle built by your packager,
|
|
134
|
+
* after whatever transpilation or minimization steps happen. You will need to maintain sourcemaps to decode them if desired.
|
|
135
|
+
*
|
|
136
|
+
* #### Example
|
|
137
|
+
*
|
|
138
|
+
* ```js
|
|
139
|
+
* const crashlytics = getCrashlytics();
|
|
140
|
+
* recordError(
|
|
141
|
+
* crashlytics,
|
|
142
|
+
* new Error('An error was caught')
|
|
143
|
+
* );
|
|
144
|
+
* ```
|
|
145
|
+
* @param crashlytics A crashlytics instance.
|
|
146
|
+
* @param error Expects an instance of Error; e.g. classes that extend Error will also be supported.
|
|
147
|
+
* @param jsErrorName Optional string containing Javascript error name
|
|
148
|
+
*/
|
|
149
|
+
function recordError(crashlytics, error, jsErrorName) {
|
|
150
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
151
|
+
return crashlytics.recordError.call(crashlytics, error, jsErrorName, _common.MODULAR_DEPRECATION_ARG);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Enqueues any unsent reports on the device to upload to Crashlytics. This method only applies if
|
|
156
|
+
* automatic data collection is disabled.
|
|
157
|
+
*
|
|
158
|
+
* #### Example
|
|
159
|
+
*
|
|
160
|
+
* ```js
|
|
161
|
+
* const crashlytics = getCrashlytics();
|
|
162
|
+
* sendUnsentReports(crashlytics);
|
|
163
|
+
* ```
|
|
164
|
+
* @param crashlytics A crashlytics instance.
|
|
165
|
+
*/
|
|
166
|
+
function sendUnsentReports(crashlytics) {
|
|
167
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
168
|
+
return crashlytics.sendUnsentReports.call(crashlytics, _common.MODULAR_DEPRECATION_ARG);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Specify a user identifier which will be visible in the Firebase Crashlytics console.
|
|
173
|
+
*
|
|
174
|
+
* It is recommended for privacy purposes that this value be a value that's meaningless to a third-party
|
|
175
|
+
* observer; such as an arbitrary string that ties an end-user to a record in your system e.g. a database record id.
|
|
176
|
+
*
|
|
177
|
+
* #### Example
|
|
178
|
+
*
|
|
179
|
+
* ```js
|
|
180
|
+
* const auth = getAuth();
|
|
181
|
+
* const crashlytics = getCrashlytics();
|
|
182
|
+
* // Custom user id
|
|
183
|
+
* await setUserId(crashlytics, '123456789');
|
|
184
|
+
* // Firebase auth uid
|
|
185
|
+
* await setUserId(
|
|
186
|
+
* crashlytics,
|
|
187
|
+
* auth.currentUser.uid
|
|
188
|
+
* );
|
|
189
|
+
* ```
|
|
190
|
+
* @param crashlytics A crashlytics instance.
|
|
191
|
+
* @param userId An arbitrary string that ties an end-user to a record in your system e.g. a database record id.
|
|
192
|
+
*/
|
|
193
|
+
function setUserId(crashlytics, userId) {
|
|
194
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
195
|
+
return crashlytics.setUserId.call(crashlytics, userId, _common.MODULAR_DEPRECATION_ARG);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console.
|
|
200
|
+
*
|
|
201
|
+
* #### Example
|
|
202
|
+
*
|
|
203
|
+
* ```js
|
|
204
|
+
* const crashlytics = getCrashlytics();
|
|
205
|
+
* await setAttribute(crashlytics, 'role', 'admin');
|
|
206
|
+
* ```
|
|
207
|
+
* @param crashlytics A crashlytics instance.
|
|
208
|
+
* @param name The name of the attribute to set.
|
|
209
|
+
* @param value A string value for the given attribute.
|
|
210
|
+
*/
|
|
211
|
+
function setAttribute(crashlytics, name, value) {
|
|
212
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
213
|
+
return crashlytics.setAttribute.call(crashlytics, name, value, _common.MODULAR_DEPRECATION_ARG);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Like `setAttribute` but for multiple attributes.
|
|
218
|
+
*
|
|
219
|
+
* #### Example
|
|
220
|
+
*
|
|
221
|
+
* ```js
|
|
222
|
+
* const crashlytics = getCrashlytics();
|
|
223
|
+
* await setAttributes(crashlytics, {
|
|
224
|
+
* role: 'admin',
|
|
225
|
+
* followers: '13',
|
|
226
|
+
* });
|
|
227
|
+
* ```
|
|
228
|
+
* @param crashlytics A crashlytics instance.
|
|
229
|
+
* @param attributes An object of key/value attribute name and values.
|
|
230
|
+
*/
|
|
231
|
+
function setAttributes(crashlytics, attributes) {
|
|
232
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
233
|
+
return crashlytics.setAttributes.call(crashlytics, attributes, _common.MODULAR_DEPRECATION_ARG);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Enable/disable Crashlytics reporting.
|
|
238
|
+
*
|
|
239
|
+
* Use this for opt-in first user data collection flows combined with `firebase.json` settings to disable auto collection.
|
|
240
|
+
*
|
|
241
|
+
* #### Example
|
|
242
|
+
*
|
|
243
|
+
* ```js
|
|
244
|
+
* const crashlytics = getCrashlytics();
|
|
245
|
+
* // Disable crash reporting
|
|
246
|
+
* await setCrashlyticsCollectionEnabled(crashlytics, false);
|
|
247
|
+
* ```
|
|
248
|
+
* @param crashlytics A crashlytics instance.
|
|
249
|
+
* @param enabled A boolean value representing whether to enable Crashlytics error collection.
|
|
250
|
+
*/
|
|
251
|
+
function setCrashlyticsCollectionEnabled(crashlytics, enabled) {
|
|
252
|
+
return crashlytics.setCrashlyticsCollectionEnabled.call(crashlytics, enabled,
|
|
253
|
+
// @ts-ignore - MODULAR_DEPRECATION_ARG is not defined in the global scope
|
|
254
|
+
_common.MODULAR_DEPRECATION_ARG);
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=modular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_app","require","_common","getCrashlytics","getApp","crashlytics","checkForUnsentReports","call","MODULAR_DEPRECATION_ARG","deleteUnsentReports","didCrashOnPreviousExecution","crash","log","message","recordError","error","jsErrorName","sendUnsentReports","setUserId","userId","setAttribute","name","value","setAttributes","attributes","setCrashlyticsCollectionEnabled","enabled"],"sourceRoot":"../../lib","sources":["modular.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,cAAcA,CAAA,EAAgB;EAC5C,OAAO,IAAAC,WAAM,EAAC,CAAC,CAACC,WAAW,CAAC,CAAC;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAACD,WAAwB,EAAoB;EAChF;EACA,OAAOA,WAAW,CAACC,qBAAqB,CAACC,IAAI,CAACF,WAAW,EAAEG,+BAAuB,CAAC;AACrF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAACJ,WAAwB,EAAiB;EAC3E;EACA,OAAOA,WAAW,CAACI,mBAAmB,CAACF,IAAI,CAACF,WAAW,EAAEG,+BAAuB,CAAC;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,2BAA2BA,CAACL,WAAwB,EAAoB;EACtF;EACA,OAAOA,WAAW,CAACK,2BAA2B,CAACH,IAAI,CAACF,WAAW,EAAEG,+BAAuB,CAAC;AAC3F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,KAAKA,CAACN,WAAwB,EAAQ;EACpD;EACA,OAAOA,WAAW,CAACM,KAAK,CAACJ,IAAI,CAACF,WAAW,EAAEG,+BAAuB,CAAC;AACrE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,GAAGA,CAACP,WAAwB,EAAEQ,OAAe,EAAQ;EACnE;EACA,OAAOR,WAAW,CAACO,GAAG,CAACL,IAAI,CAACF,WAAW,EAAEQ,OAAO,EAAEL,+BAAuB,CAAC;AAC5E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAACT,WAAwB,EAAEU,KAAY,EAAEC,WAAoB,EAAQ;EAC9F;EACA,OAAOX,WAAW,CAACS,WAAW,CAACP,IAAI,CAACF,WAAW,EAAEU,KAAK,EAAEC,WAAW,EAAER,+BAAuB,CAAC;AAC/F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,iBAAiBA,CAACZ,WAAwB,EAAQ;EAChE;EACA,OAAOA,WAAW,CAACY,iBAAiB,CAACV,IAAI,CAACF,WAAW,EAAEG,+BAAuB,CAAC;AACjF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,SAASA,CAACb,WAAwB,EAAEc,MAAc,EAAiB;EACjF;EACA,OAAOd,WAAW,CAACa,SAAS,CAACX,IAAI,CAACF,WAAW,EAAEc,MAAM,EAAEX,+BAAuB,CAAC;AACjF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASY,YAAYA,CAACf,WAAwB,EAAEgB,IAAY,EAAEC,KAAa,EAAiB;EACjG;EACA,OAAOjB,WAAW,CAACe,YAAY,CAACb,IAAI,CAACF,WAAW,EAAEgB,IAAI,EAAEC,KAAK,EAAEd,+BAAuB,CAAC;AACzF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASe,aAAaA,CAC3BlB,WAAwB,EACxBmB,UAAqC,EACtB;EACf;EACA,OAAOnB,WAAW,CAACkB,aAAa,CAAChB,IAAI,CAACF,WAAW,EAAEmB,UAAU,EAAEhB,+BAAuB,CAAC;AACzF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,+BAA+BA,CAC7CpB,WAAwB,EACxBqB,OAAgB,EACD;EACf,OAAOrB,WAAW,CAACoB,+BAA+B,CAAClB,IAAI,CACrDF,WAAW,EACXqB,OAAO;EACP;EACAlB,+BACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.firebase = exports.default = exports.SDK_VERSION = void 0;
|
|
7
|
+
var _app = require("@react-native-firebase/app");
|
|
8
|
+
var _common = require("@react-native-firebase/app/lib/common");
|
|
9
|
+
var _internal = require("@react-native-firebase/app/lib/internal");
|
|
10
|
+
var _stacktraceJs = _interopRequireDefault(require("stacktrace-js"));
|
|
11
|
+
var _handlers = require("./handlers.js");
|
|
12
|
+
var _version = require("./version.js");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/* eslint-disable no-console */
|
|
15
|
+
/*
|
|
16
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
17
|
+
*
|
|
18
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this library except in compliance with the License.
|
|
20
|
+
* You may obtain a copy of the License at
|
|
21
|
+
*
|
|
22
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
25
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
|
+
* See the License for the specific language governing permissions and
|
|
28
|
+
* limitations under the License.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const statics = {};
|
|
33
|
+
const namespace = 'crashlytics';
|
|
34
|
+
const nativeModuleName = 'RNFBCrashlyticsModule';
|
|
35
|
+
class FirebaseCrashlyticsModule extends _internal.FirebaseModule {
|
|
36
|
+
constructor(app, config, customUrlOrRegion) {
|
|
37
|
+
super(app, config, customUrlOrRegion);
|
|
38
|
+
(0, _handlers.setGlobalErrorHandler)(this.native);
|
|
39
|
+
(0, _handlers.setOnUnhandledPromiseRejectionHandler)(this.native);
|
|
40
|
+
this._isCrashlyticsCollectionEnabled = this.native.isCrashlyticsCollectionEnabled;
|
|
41
|
+
}
|
|
42
|
+
get isCrashlyticsCollectionEnabled() {
|
|
43
|
+
// Purposefully did not deprecate this as I think it should remain a property rather than a method.
|
|
44
|
+
return this._isCrashlyticsCollectionEnabled;
|
|
45
|
+
}
|
|
46
|
+
checkForUnsentReports() {
|
|
47
|
+
if (this.isCrashlyticsCollectionEnabled) {
|
|
48
|
+
throw new Error("firebase.crashlytics().setCrashlyticsCollectionEnabled(*) has been set to 'true', all reports are automatically sent.");
|
|
49
|
+
}
|
|
50
|
+
return this.native.checkForUnsentReports();
|
|
51
|
+
}
|
|
52
|
+
crash() {
|
|
53
|
+
this.native.crash();
|
|
54
|
+
}
|
|
55
|
+
async deleteUnsentReports() {
|
|
56
|
+
await this.native.deleteUnsentReports();
|
|
57
|
+
}
|
|
58
|
+
didCrashOnPreviousExecution() {
|
|
59
|
+
return this.native.didCrashOnPreviousExecution();
|
|
60
|
+
}
|
|
61
|
+
log(message) {
|
|
62
|
+
this.native.log(`${message}`);
|
|
63
|
+
}
|
|
64
|
+
setAttribute(name, value) {
|
|
65
|
+
if (!(0, _common.isString)(name)) {
|
|
66
|
+
throw new Error('firebase.crashlytics().setAttribute(*, _): The supplied property name must be a string.');
|
|
67
|
+
}
|
|
68
|
+
if (!(0, _common.isString)(value)) {
|
|
69
|
+
throw new Error('firebase.crashlytics().setAttribute(_, *): The supplied property value must be a string value.');
|
|
70
|
+
}
|
|
71
|
+
return this.native.setAttribute(name, value);
|
|
72
|
+
}
|
|
73
|
+
setAttributes(object) {
|
|
74
|
+
if (!(0, _common.isObject)(object)) {
|
|
75
|
+
throw new Error('firebase.crashlytics().setAttributes(*): The supplied arg must be an object of key value strings.');
|
|
76
|
+
}
|
|
77
|
+
return this.native.setAttributes(object);
|
|
78
|
+
}
|
|
79
|
+
setUserId(userId) {
|
|
80
|
+
if (!(0, _common.isString)(userId)) {
|
|
81
|
+
throw new Error('firebase.crashlytics().setUserId(*): The supplied userId must be a string value.');
|
|
82
|
+
}
|
|
83
|
+
return this.native.setUserId(userId);
|
|
84
|
+
}
|
|
85
|
+
recordError(error, jsErrorName) {
|
|
86
|
+
if ((0, _common.isError)(error)) {
|
|
87
|
+
_stacktraceJs.default.fromError(error, {
|
|
88
|
+
offline: true
|
|
89
|
+
}).then(stackFrames => {
|
|
90
|
+
this.native.recordError((0, _handlers.createNativeErrorObj)(error, stackFrames, false, jsErrorName));
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
console.warn('firebase.crashlytics().recordError(*) expects an instance of Error. Non Errors will be ignored.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
sendUnsentReports() {
|
|
97
|
+
if (this.isCrashlyticsCollectionEnabled) {
|
|
98
|
+
this.native.sendUnsentReports();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
setCrashlyticsCollectionEnabled(enabled) {
|
|
102
|
+
if (!(0, _common.isBoolean)(enabled)) {
|
|
103
|
+
throw new Error("firebase.crashlytics().setCrashlyticsCollectionEnabled(*) 'enabled' must be a boolean.");
|
|
104
|
+
}
|
|
105
|
+
this._isCrashlyticsCollectionEnabled = enabled;
|
|
106
|
+
return this.native.setCrashlyticsCollectionEnabled(enabled);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// import { SDK_VERSION } from '@react-native-firebase/crashlytics';
|
|
111
|
+
const SDK_VERSION = exports.SDK_VERSION = _version.version;
|
|
112
|
+
const crashlyticsNamespace = (0, _internal.createModuleNamespace)({
|
|
113
|
+
statics,
|
|
114
|
+
version: _version.version,
|
|
115
|
+
namespace,
|
|
116
|
+
nativeModuleName,
|
|
117
|
+
nativeEvents: false,
|
|
118
|
+
hasMultiAppSupport: false,
|
|
119
|
+
hasCustomUrlOrRegionSupport: false,
|
|
120
|
+
ModuleClass: FirebaseCrashlyticsModule
|
|
121
|
+
});
|
|
122
|
+
// import crashlytics from '@react-native-firebase/crashlytics';
|
|
123
|
+
// crashlytics().X(...);
|
|
124
|
+
var _default = exports.default = crashlyticsNamespace; // import crashlytics, { firebase } from '@react-native-firebase/crashlytics';
|
|
125
|
+
// crashlytics().X(...);
|
|
126
|
+
// firebase.crashlytics().X(...);
|
|
127
|
+
const firebase = exports.firebase = (0, _internal.getFirebaseRoot)();
|
|
128
|
+
|
|
129
|
+
// Register the interop module for non-native platforms.
|
|
130
|
+
// Note: This package doesn't have a web fallback module like functions does
|
|
131
|
+
// setReactNativeModule(nativeModuleName, fallBackModule);
|
|
132
|
+
|
|
133
|
+
// This will throw with 'Default App Not initialized' if the default app is not configured.
|
|
134
|
+
if (!_common.isOther) {
|
|
135
|
+
// @ts-ignore - Extra arg used by deprecation proxy to detect namespaced calls
|
|
136
|
+
firebase.crashlytics.call(null, (0, _app.getApp)(), _common.MODULAR_DEPRECATION_ARG);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=namespaced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_app","require","_common","_internal","_stacktraceJs","_interopRequireDefault","_handlers","_version","e","__esModule","default","statics","namespace","nativeModuleName","FirebaseCrashlyticsModule","FirebaseModule","constructor","app","config","customUrlOrRegion","setGlobalErrorHandler","native","setOnUnhandledPromiseRejectionHandler","_isCrashlyticsCollectionEnabled","isCrashlyticsCollectionEnabled","checkForUnsentReports","Error","crash","deleteUnsentReports","didCrashOnPreviousExecution","log","message","setAttribute","name","value","isString","setAttributes","object","isObject","setUserId","userId","recordError","error","jsErrorName","isError","StackTrace","fromError","offline","then","stackFrames","createNativeErrorObj","console","warn","sendUnsentReports","setCrashlyticsCollectionEnabled","enabled","isBoolean","SDK_VERSION","exports","version","crashlyticsNamespace","createModuleNamespace","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","_default","firebase","getFirebaseRoot","isOther","crashlytics","call","getApp","MODULAR_DEPRECATION_ARG"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;;;;;AAkBA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AASA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AAAoC,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvCpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2BA,MAAMG,OAAyB,GAAG,CAAC,CAAC;AAEpC,MAAMC,SAAS,GAAG,aAAa;AAE/B,MAAMC,gBAAgB,GAAG,uBAAuB;AAEhD,MAAMC,yBAAyB,SAASC,wBAAc,CAAC;EAGrDC,WAAWA,CACTC,GAAwC,EACxCC,MAAoB,EACpBC,iBAAiC,EACjC;IACA,KAAK,CAACF,GAAG,EAAEC,MAAM,EAAEC,iBAAiB,CAAC;IACrC,IAAAC,+BAAqB,EAAC,IAAI,CAACC,MAAM,CAAC;IAClC,IAAAC,+CAAqC,EAAC,IAAI,CAACD,MAAM,CAAC;IAClD,IAAI,CAACE,+BAA+B,GAAG,IAAI,CAACF,MAAM,CAACG,8BAA8B;EACnF;EAEA,IAAIA,8BAA8BA,CAAA,EAAY;IAC5C;IACA,OAAO,IAAI,CAACD,+BAA+B;EAC7C;EAEAE,qBAAqBA,CAAA,EAAqB;IACx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