File tree 4 files changed +28
-0
lines changed
android/src/main/java/io/sentry/react
sample-new-architecture/src
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ ### Breaking changes
6
+
7
+ - Events captured by Native SDKs are reporting as RN SDK ([ #2814 ] ( https://github.com/getsentry/sentry-react-native/pull/2814 ) )
8
+
3
9
## 5.0.0-beta.2
4
10
5
11
### Features
Original file line number Diff line number Diff line change 10
10
import android .util .SparseIntArray ;
11
11
12
12
import androidx .annotation .Nullable ;
13
+ import androidx .annotation .NonNull ;
13
14
import androidx .core .app .FrameMetricsAggregator ;
14
15
15
16
import com .facebook .react .bridge .Arguments ;
@@ -102,6 +103,17 @@ Activity getCurrentActivity() {
102
103
103
104
public void initNativeSdk (final ReadableMap rnOptions , Promise promise ) {
104
105
SentryAndroid .init (this .getReactApplicationContext (), options -> {
106
+ if (rnOptions .hasKey ("_metadata" )) {
107
+ @ Nullable final ReadableMap metadata = rnOptions .getMap ("_metadata" );
108
+ @ Nullable final ReadableMap sdkMap = metadata != null ? metadata .getMap ("sdk" ) : null ;
109
+ @ Nullable final String sdkMapName = sdkMap != null ? sdkMap .getString ("name" ) : null ;
110
+ @ Nullable final String sdkMapVersion = sdkMap != null ? sdkMap .getString ("version" ) : null ;
111
+ if (sdkMapName != null && sdkMapVersion != null ) {
112
+ @ NonNull final SdkVersion sdkVersion = new SdkVersion (sdkMapName , sdkMapVersion );
113
+ options .setSentryClientName (sdkMapName + "/" + sdkMapVersion );
114
+ options .setSdkVersion (sdkVersion );
115
+ }
116
+ }
105
117
if (rnOptions .hasKey ("debug" ) && rnOptions .getBoolean ("debug" )) {
106
118
options .setDebug (true );
107
119
}
Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ + (BOOL)requiresMainQueueSetup {
56
56
return ;
57
57
}
58
58
59
+ if ([options[@" _metadata" ] isKindOfClass: [NSDictionary class ]]
60
+ && [options[@" _metadata" ][@" sdk" ] isKindOfClass: [NSDictionary class ]]
61
+ && [options[@" _metadata" ][@" sdk" ][@" name" ] isKindOfClass: [NSString class ]]
62
+ && [options[@" _metadata" ][@" sdk" ][@" version" ] isKindOfClass: [NSString class ]]) {
63
+ [PrivateSentrySDKOnly
64
+ setSdkName: options[@" _metadata" ][@" sdk" ][@" name" ]
65
+ andVersionString: options[@" _metadata" ][@" sdk" ][@" version" ]];
66
+ }
67
+
59
68
[SentrySDK startWithOptions: sentryOptions];
60
69
61
70
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ Sentry.init({
59
59
// This will capture ALL TRACES and likely use up all your quota
60
60
tracesSampleRate : 1.0 ,
61
61
attachStacktrace : true ,
62
+ attachScreenshot : true ,
62
63
// Sets the `release` and `dist` on Sentry events. Make sure this matches EXACTLY with the values on your sourcemaps
63
64
// otherwise they will not work.
64
65
// release: '[email protected] +1',
You can’t perform that action at this time.
0 commit comments