@sentry/react-native 7.12.0 → 8.0.0-beta.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/RNSentry.podspec +9 -4
- package/android/libs/replay-stubs.jar +0 -0
- package/android/src/main/java/io/sentry/react/RNSentryCompositeOptionsConfiguration.java +25 -0
- package/android/src/main/java/io/sentry/react/RNSentryJsonConverter.java +76 -0
- package/android/src/main/java/io/sentry/react/RNSentryJsonUtils.java +41 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +2 -395
- package/android/src/main/java/io/sentry/react/RNSentrySDK.java +68 -0
- package/android/src/main/java/io/sentry/react/RNSentryStart.java +413 -0
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/replay/mobilereplay.d.ts +0 -26
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +21 -10
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/metroconfig.d.ts +9 -1
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js +9 -2
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +1 -0
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/sentryOptionsSerializer.d.ts +6 -0
- package/dist/js/tools/sentryOptionsSerializer.d.ts.map +1 -0
- package/dist/js/tools/sentryOptionsSerializer.js +92 -0
- package/dist/js/tools/sentryOptionsSerializer.js.map +1 -0
- package/dist/js/tools/utils.d.ts +2 -1
- package/dist/js/tools/utils.d.ts.map +1 -1
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +2 -0
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/ios/RNSentry+fetchNativeStack.m +1 -0
- package/ios/RNSentry.h +3 -0
- package/ios/RNSentry.mm +12 -45
- package/ios/RNSentryDependencyContainer.h +2 -1
- package/ios/RNSentryDependencyContainer.m +1 -0
- package/ios/RNSentryEmitNewFrameEvent.h +3 -0
- package/ios/RNSentryExperimentalOptions.m +1 -1
- package/ios/RNSentryFramesTrackerListener.h +2 -2
- package/ios/RNSentryFramesTrackerListener.m +2 -0
- package/ios/RNSentryOnDrawReporter.h +2 -1
- package/ios/RNSentryOnDrawReporter.m +2 -0
- package/ios/RNSentryRNSScreen.m +3 -4
- package/ios/RNSentryReplay.mm +0 -5
- package/ios/RNSentryReplayBreadcrumbConverter.m +12 -12
- package/ios/RNSentrySDK.h +31 -0
- package/ios/RNSentrySDK.m +78 -0
- package/ios/RNSentryStart.h +25 -0
- package/ios/RNSentryStart.m +228 -0
- package/ios/RNSentryVersion.m +1 -1
- package/ios/SentrySDKWrapper.m +2 -2
- package/ios/SentryScreenFramesWrapper.h +14 -0
- package/ios/SentryScreenFramesWrapper.m +39 -0
- package/package.json +2 -2
- package/plugin/build/logger.d.ts +24 -0
- package/plugin/build/logger.js +44 -0
- package/plugin/build/utils.d.ts +0 -18
- package/plugin/build/utils.js +1 -34
- package/plugin/build/version.d.ts +2 -0
- package/plugin/build/version.js +6 -0
- package/plugin/build/withSentry.d.ts +1 -0
- package/plugin/build/withSentry.js +11 -10
- package/plugin/build/withSentryAndroid.d.ts +6 -1
- package/plugin/build/withSentryAndroid.js +52 -8
- package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +8 -8
- package/plugin/build/withSentryIOS.d.ts +6 -1
- package/plugin/build/withSentryIOS.js +55 -7
- package/scripts/sentry-xcode.sh +20 -0
- package/sentry.gradle +51 -0
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +0 -26
- package/ts3.8/dist/js/utils/worldwide.d.ts +2 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,qCAAqC;IACpD,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;QAChE,6BAA6B,CAAC,EAAE,CAAC,OAAO,EAAE,qCAAqC,KAAK,IAAI,CAAC;QACzF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;KAC5B,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;IACvC,OAAO,CAAC,EAAE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sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmD1C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAuC,CAAC","sourcesContent":["import type { InternalGlobal } from '@sentry/core';\nimport { GLOBAL_OBJ } from '@sentry/core';\nimport type { ErrorUtils } from 'react-native/types';\nimport type { ReactNativeOptions } from '../options';\nimport type { ExpoGlobalObject } from './expoglobalobject';\n\nexport interface HermesPromiseRejectionTrackingOptions {\n allRejections: boolean;\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** Internal Global object interface with common and Sentry specific properties */\nexport interface ReactNativeInternalGlobal extends InternalGlobal {\n __sentry_rn_v4_registered?: boolean;\n __sentry_rn_v5_registered?: boolean;\n HermesInternal?: {\n getRuntimeProperties?: () => Record<string, string | undefined>;\n enablePromiseRejectionTracker?: (options: HermesPromiseRejectionTrackingOptions) => void;\n hasPromise?: () => boolean;\n };\n Promise: unknown;\n __turboModuleProxy: unknown;\n RN$Bridgeless: unknown;\n nativeFabricUIManager: unknown;\n ErrorUtils?: ErrorUtils;\n expo?: ExpoGlobalObject;\n XMLHttpRequest?: typeof XMLHttpRequest;\n process?: {\n env?: {\n ___SENTRY_METRO_DEV_SERVER___?: string;\n };\n };\n __BUNDLE_START_TIME__?: number;\n nativePerformanceNow?: () => number;\n TextEncoder?: TextEncoder;\n alert?: (message: string) => void;\n __SENTRY_OPTIONS__?: ReactNativeOptions;\n SENTRY_RELEASE?: {\n /** Used by Sentry Webpack Plugin, not used by RN, only to silence TS */\n id?: string;\n name?: string;\n version?: string;\n };\n}\n\ntype TextEncoder = {\n new (): {\n encode(input?: string): Uint8Array;\n };\n};\n\n/** Get's the global object for the current JavaScript runtime */\nexport const RN_GLOBAL_OBJ = GLOBAL_OBJ as ReactNativeInternalGlobal;\n"]}
|
package/dist/js/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
|
|
2
2
|
export declare const SDK_NAME = "sentry.javascript.react-native";
|
|
3
|
-
export declare const SDK_VERSION = "
|
|
3
|
+
export declare const SDK_VERSION = "8.0.0-beta.0";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/js/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,iBAAiB,CAAC"}
|
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '8.0.0-beta.0';\n"]}
|
package/ios/RNSentry.h
CHANGED
package/ios/RNSentry.mm
CHANGED
|
@@ -24,9 +24,7 @@
|
|
|
24
24
|
#import <Sentry/SentryDebugMeta.h>
|
|
25
25
|
#import <Sentry/SentryEvent.h>
|
|
26
26
|
#import <Sentry/SentryException.h>
|
|
27
|
-
#import <Sentry/SentryFormatter.h>
|
|
28
27
|
#import <Sentry/SentryGeo.h>
|
|
29
|
-
#import <Sentry/SentryScreenFrames.h>
|
|
30
28
|
#import <Sentry/SentryUser.h>
|
|
31
29
|
|
|
32
30
|
// This guard prevents importing Hermes in JSC apps
|
|
@@ -47,18 +45,19 @@
|
|
|
47
45
|
#endif
|
|
48
46
|
|
|
49
47
|
#if SENTRY_HAS_UIKIT
|
|
50
|
-
# import "
|
|
48
|
+
# import "RNSentryEmitNewFrameEvent.h"
|
|
51
49
|
# import "RNSentryRNSScreen.h"
|
|
52
50
|
#endif
|
|
53
51
|
|
|
54
52
|
#import "RNSentryExperimentalOptions.h"
|
|
53
|
+
#import "RNSentryStart.h"
|
|
55
54
|
#import "RNSentryVersion.h"
|
|
56
55
|
#import "SentrySDKWrapper.h"
|
|
56
|
+
#import "SentryScreenFramesWrapper.h"
|
|
57
57
|
|
|
58
58
|
static bool hasFetchedAppStart;
|
|
59
59
|
|
|
60
60
|
@implementation RNSentry {
|
|
61
|
-
bool sentHybridSdkDidBecomeActive;
|
|
62
61
|
bool hasListeners;
|
|
63
62
|
RNSentryTimeToDisplay *_timeToDisplay;
|
|
64
63
|
NSArray<NSString *> *_ignoreErrorPatternsStr;
|
|
@@ -143,43 +142,17 @@ RCT_EXPORT_METHOD(initNativeSdk : (NSDictionary *_Nonnull)options resolve : (
|
|
|
143
142
|
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
144
143
|
{
|
|
145
144
|
NSMutableDictionary *mutableOptions = [self prepareOptions:options];
|
|
146
|
-
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
147
|
-
BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions];
|
|
148
|
-
#else
|
|
149
|
-
// Defaulting to false for unsupported targets
|
|
150
|
-
BOOL isSessionReplayEnabled = NO;
|
|
151
|
-
#endif
|
|
152
145
|
NSError *error = nil;
|
|
153
|
-
[
|
|
154
|
-
isSessionReplayEnabled:isSessionReplayEnabled
|
|
155
|
-
error:&error];
|
|
146
|
+
[RNSentryStart startWithOptions:mutableOptions error:&error];
|
|
156
147
|
if (error != nil) {
|
|
157
148
|
reject(@"SentryReactNative", error.localizedDescription, error);
|
|
158
149
|
return;
|
|
159
150
|
}
|
|
160
151
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
BOOL appIsActive = [[NSApplication sharedApplication] isActive];
|
|
166
|
-
#endif
|
|
167
|
-
|
|
168
|
-
// If the app is active/in foreground, and we have not sent the SentryHybridSdkDidBecomeActive
|
|
169
|
-
// notification, send it.
|
|
170
|
-
if (appIsActive && !sentHybridSdkDidBecomeActive
|
|
171
|
-
&& ([SentrySDKWrapper enableAutoSessionTracking] ||
|
|
172
|
-
[SentrySDKWrapper enableWatchdogTerminationTracking])) {
|
|
173
|
-
[[NSNotificationCenter defaultCenter] postNotificationName:@"SentryHybridSdkDidBecomeActive"
|
|
174
|
-
object:nil];
|
|
175
|
-
|
|
176
|
-
sentHybridSdkDidBecomeActive = true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
180
|
-
[RNSentryReplay postInit];
|
|
181
|
-
#endif
|
|
182
|
-
|
|
152
|
+
// RNSentryStart.startWithOptions already handles:
|
|
153
|
+
// - Session tracking notification (SentryHybridSdkDidBecomeActive)
|
|
154
|
+
// - Replay postInit
|
|
155
|
+
// - SDK initialization
|
|
183
156
|
resolve(@YES);
|
|
184
157
|
}
|
|
185
158
|
|
|
@@ -499,21 +472,15 @@ RCT_EXPORT_METHOD(
|
|
|
499
472
|
|
|
500
473
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
501
474
|
if (PrivateSentrySDKOnly.isFramesTrackingRunning) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (frames == nil) {
|
|
475
|
+
if (![SentryScreenFramesWrapper canTrackFrames]) {
|
|
505
476
|
resolve(nil);
|
|
506
477
|
return;
|
|
507
478
|
}
|
|
508
479
|
|
|
509
|
-
NSNumber *total = [NSNumber numberWithLong:frames.total];
|
|
510
|
-
NSNumber *frozen = [NSNumber numberWithLong:frames.frozen];
|
|
511
|
-
NSNumber *slow = [NSNumber numberWithLong:frames.slow];
|
|
512
|
-
|
|
513
480
|
resolve(@ {
|
|
514
|
-
@"totalFrames" :
|
|
515
|
-
@"frozenFrames" :
|
|
516
|
-
@"slowFrames" :
|
|
481
|
+
@"totalFrames" : [SentryScreenFramesWrapper totalFrames],
|
|
482
|
+
@"frozenFrames" : [SentryScreenFramesWrapper frozenFrames],
|
|
483
|
+
@"slowFrames" : [SentryScreenFramesWrapper slowFrames],
|
|
517
484
|
});
|
|
518
485
|
} else {
|
|
519
486
|
resolve(nil);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
+
# import "RNSentryEmitNewFrameEvent.h"
|
|
5
6
|
# import <Foundation/Foundation.h>
|
|
6
7
|
# import <React/RCTEventEmitter.h>
|
|
7
|
-
# import <Sentry/SentryFramesTracker.h>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
@import Sentry;
|
|
10
10
|
|
|
11
11
|
@protocol RNSentryFramesTrackerListenerProtocol <SentryFramesTrackerListener>
|
|
12
12
|
|
package/ios/RNSentryRNSScreen.m
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
#if SENTRY_HAS_UIKIT
|
|
4
4
|
|
|
5
|
-
# import <Sentry/SentryDependencyContainer.h>
|
|
6
|
-
# import <Sentry/SentryFramesTracker.h>
|
|
7
|
-
# import <Sentry/SentrySwizzle.h>
|
|
8
|
-
|
|
9
5
|
# import "RNSentryDependencyContainer.h"
|
|
6
|
+
# import "RNSentryFramesTrackerListener.h"
|
|
7
|
+
# import "SentrySwizzle.h"
|
|
8
|
+
@import Sentry;
|
|
10
9
|
|
|
11
10
|
@implementation RNSentryRNSScreen
|
|
12
11
|
|
package/ios/RNSentryReplay.mm
CHANGED
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
|
|
28
28
|
NSString *qualityString = options[@"replaysSessionQuality"];
|
|
29
29
|
|
|
30
|
-
NSArray *includedViewClasses = replayOptions[@"includedViewClasses"];
|
|
31
|
-
NSArray *excludedViewClasses = replayOptions[@"excludedViewClasses"];
|
|
32
|
-
|
|
33
30
|
[options setValue:@{
|
|
34
31
|
@"sessionSampleRate" : sessionSampleRate ?: [NSNull null],
|
|
35
32
|
@"errorSampleRate" : errorSampleRate ?: [NSNull null],
|
|
@@ -39,8 +36,6 @@
|
|
|
39
36
|
@"enableViewRendererV2" : replayOptions[@"enableViewRendererV2"] ?: [NSNull null],
|
|
40
37
|
@"enableFastViewRendering" : replayOptions[@"enableFastViewRendering"] ?: [NSNull null],
|
|
41
38
|
@"maskedViewClasses" : [RNSentryReplay getReplayRNRedactClasses:replayOptions],
|
|
42
|
-
@"includedViewClasses" : includedViewClasses ?: [NSNull null],
|
|
43
|
-
@"excludedViewClasses" : excludedViewClasses ?: [NSNull null],
|
|
44
39
|
@"sdkInfo" :
|
|
45
40
|
@ { @"name" : REACT_NATIVE_SDK_NAME, @"version" : REACT_NATIVE_SDK_PACKAGE_VERSION }
|
|
46
41
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- (instancetype _Nonnull)init
|
|
12
12
|
{
|
|
13
13
|
if (self = [super init]) {
|
|
14
|
-
self->defaultConverter = [
|
|
14
|
+
self->defaultConverter = [SentrySessionReplayHybridSDK createDefaultBreadcrumbConverter];
|
|
15
15
|
}
|
|
16
16
|
return self;
|
|
17
17
|
}
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if ([breadcrumb.category isEqualToString:@"navigation"]) {
|
|
39
|
-
return [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
return [SentrySessionReplayHybridSDK createBreadcrumbwithTimestamp:breadcrumb.timestamp
|
|
40
|
+
category:breadcrumb.category
|
|
41
|
+
message:nil
|
|
42
|
+
level:breadcrumb.level
|
|
43
|
+
data:breadcrumb.data];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if ([breadcrumb.category isEqualToString:@"xhr"]) {
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
NSMutableArray *path = [breadcrumb.data valueForKey:@"path"];
|
|
69
69
|
NSString *message = [RNSentryReplayBreadcrumbConverter getTouchPathMessageFrom:path];
|
|
70
70
|
|
|
71
|
-
return [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
return [SentrySessionReplayHybridSDK createBreadcrumbwithTimestamp:breadcrumb.timestamp
|
|
72
|
+
category:@"ui.tap"
|
|
73
|
+
message:message
|
|
74
|
+
level:breadcrumb.level
|
|
75
|
+
data:breadcrumb.data];
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
+ (NSString *_Nullable)getTouchPathMessageFrom:(NSArray *_Nullable)path
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
data[@"responseBodySize"] = breadcrumb.data[@"response_body_size"];
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
return [
|
|
159
|
+
return [SentrySessionReplayHybridSDK
|
|
160
160
|
createNetworkBreadcrumbWithTimestamp:[NSDate
|
|
161
161
|
dateWithTimeIntervalSince1970:(startTimestamp
|
|
162
162
|
.doubleValue
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import <Sentry/Sentry.h>
|
|
2
|
+
|
|
3
|
+
@interface RNSentrySDK : NSObject
|
|
4
|
+
SENTRY_NO_INIT
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @experimental
|
|
8
|
+
* Inits and configures Sentry for React Native applications using `sentry.options.json`
|
|
9
|
+
* configuration file.
|
|
10
|
+
*
|
|
11
|
+
* @discussion Call this method on the main thread. When calling it from a background thread, the
|
|
12
|
+
* SDK starts on the main thread async.
|
|
13
|
+
*/
|
|
14
|
+
+ (void)start;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @experimental
|
|
18
|
+
* Inits and configures Sentry for React Native applicationsusing `sentry.options.json`
|
|
19
|
+
* configuration file and `configureOptions` callback.
|
|
20
|
+
*
|
|
21
|
+
* The `configureOptions` callback can overwrite the config file options
|
|
22
|
+
* and add non-serializable items to the options object.
|
|
23
|
+
*
|
|
24
|
+
* @discussion Call this method on the main thread. When calling it from a background thread, the
|
|
25
|
+
* SDK starts on the main thread async.
|
|
26
|
+
*/
|
|
27
|
+
+ (void)startWithConfigureOptions:
|
|
28
|
+
(void (^_Nullable)(SentryOptions *_Nonnull options))configureOptions
|
|
29
|
+
NS_SWIFT_NAME(start(configureOptions:));
|
|
30
|
+
|
|
31
|
+
@end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#import "RNSentrySDK.h"
|
|
2
|
+
#import "RNSentryStart.h"
|
|
3
|
+
#import <Sentry/PrivateSentrySDKOnly.h>
|
|
4
|
+
#import <Sentry/Sentry.h>
|
|
5
|
+
|
|
6
|
+
static NSString *SENTRY_OPTIONS_RESOURCE_NAME = @"sentry.options";
|
|
7
|
+
static NSString *SENTRY_OPTIONS_RESOURCE_TYPE = @"json";
|
|
8
|
+
|
|
9
|
+
@implementation RNSentrySDK
|
|
10
|
+
|
|
11
|
+
+ (void)start
|
|
12
|
+
{
|
|
13
|
+
[self startWithConfigureOptions:nil];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
+ (void)startWithConfigureOptions:(void (^)(SentryOptions *options))configureOptions
|
|
17
|
+
{
|
|
18
|
+
NSString *path = [[NSBundle mainBundle] pathForResource:SENTRY_OPTIONS_RESOURCE_NAME
|
|
19
|
+
ofType:SENTRY_OPTIONS_RESOURCE_TYPE];
|
|
20
|
+
|
|
21
|
+
[self start:path configureOptions:configureOptions];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
+ (void)start:(NSString *)path configureOptions:(void (^)(SentryOptions *options))configureOptions
|
|
25
|
+
{
|
|
26
|
+
NSError *readError = nil;
|
|
27
|
+
NSError *parseError = nil;
|
|
28
|
+
NSError *optionsError = nil;
|
|
29
|
+
|
|
30
|
+
NSData *_Nullable content = nil;
|
|
31
|
+
if (path != nil) {
|
|
32
|
+
content = [NSData dataWithContentsOfFile:path options:0 error:&readError];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
NSDictionary *dict = nil;
|
|
36
|
+
if (content != nil) {
|
|
37
|
+
dict = [NSJSONSerialization JSONObjectWithData:content options:0 error:&parseError];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (readError != nil) {
|
|
41
|
+
NSLog(@"[RNSentry] Failed to load options from %@, with error: %@", path,
|
|
42
|
+
readError.localizedDescription);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (parseError != nil) {
|
|
46
|
+
NSLog(@"[RNSentry] Failed to parse JSON from %@, with error: %@", path,
|
|
47
|
+
parseError.localizedDescription);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
SentryOptions *options = nil;
|
|
51
|
+
if (dict != nil) {
|
|
52
|
+
options = [RNSentryStart createOptionsWithDictionary:dict error:&optionsError];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (optionsError != nil) {
|
|
56
|
+
NSLog(@"[RNSentry] Failed to parse options from %@, with error: %@", path,
|
|
57
|
+
optionsError.localizedDescription);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (options == nil) {
|
|
61
|
+
// Fallback in case that options file could not be parsed.
|
|
62
|
+
NSError *fallbackError = nil;
|
|
63
|
+
options = [PrivateSentrySDKOnly optionsWithDictionary:@{} didFailWithError:&fallbackError];
|
|
64
|
+
if (fallbackError != nil) {
|
|
65
|
+
NSLog(@"[RNSentry] Failed to create fallback options with error: %@",
|
|
66
|
+
fallbackError.localizedDescription);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[RNSentryStart updateWithReactDefaults:options];
|
|
71
|
+
if (configureOptions != nil) {
|
|
72
|
+
configureOptions(options);
|
|
73
|
+
}
|
|
74
|
+
[RNSentryStart updateWithReactFinals:options];
|
|
75
|
+
[RNSentryStart startWithOptions:options];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#import <Sentry/Sentry.h>
|
|
2
|
+
|
|
3
|
+
@interface RNSentryStart : NSObject
|
|
4
|
+
SENTRY_NO_INIT
|
|
5
|
+
|
|
6
|
+
+ (void)startWithOptions:(NSDictionary *_Nonnull)javascriptOptions
|
|
7
|
+
error:(NSError *_Nullable *_Nullable)errorPointer;
|
|
8
|
+
|
|
9
|
+
+ (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)options
|
|
10
|
+
error:(NSError *_Nonnull *_Nonnull)errorPointer;
|
|
11
|
+
|
|
12
|
+
+ (void)updateWithReactDefaults:(SentryOptions *)options;
|
|
13
|
+
+ (void)updateWithReactFinals:(SentryOptions *)options;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @experimental
|
|
17
|
+
* Inits and configures Sentry for React Native applications. Make sure to
|
|
18
|
+
* set a valid DSN.
|
|
19
|
+
*
|
|
20
|
+
* @discussion Call this method on the main thread. When calling it from a background thread, the
|
|
21
|
+
* SDK starts on the main thread async.
|
|
22
|
+
*/
|
|
23
|
+
+ (void)startWithOptions:(SentryOptions *)options NS_SWIFT_NAME(start(options:));
|
|
24
|
+
|
|
25
|
+
@end
|