@sentry/react-native 3.4.2 → 3.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.4.3
4
+
5
+ - feat: Support macOS (#2240) by @ospfranco
6
+
3
7
  ## 3.4.2
4
8
 
5
9
  - fix: Fix cold start appearing again after js bundle reload on Android. #2229
package/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  <p align="center">
2
- <a href="https://sentry.io" target="_blank" align="center">
3
- <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4
- </a>
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <picture>
4
+ <source srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-white.png" media="(prefers-color-scheme: dark)" />
5
+ <source srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
6
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" alt="Sentry" width="280">
7
+ </picture>
8
+ </a>
5
9
  </p>
6
10
 
7
11
  _Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us [<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_
@@ -1,3 +1,3 @@
1
1
  export declare const SDK_NAME = "sentry.javascript.react-native";
2
- export declare const SDK_VERSION = "3.4.2";
2
+ export declare const SDK_VERSION = "3.4.3";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  export const SDK_NAME = 'sentry.javascript.react-native';
2
- export const SDK_VERSION = '3.4.2';
2
+ export const SDK_VERSION = '3.4.3';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '3.4.2';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '3.4.3';\n"]}
package/ios/RNSentry.m CHANGED
@@ -90,13 +90,21 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
90
90
  BOOL enableAutoPerformanceTracking = (BOOL)[mutableOptions valueForKey:@"enableAutoPerformanceTracking"];
91
91
 
92
92
  PrivateSentrySDKOnly.appStartMeasurementHybridSDKMode = enableAutoPerformanceTracking;
93
+ #if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
93
94
  PrivateSentrySDKOnly.framesTrackingMeasurementHybridSDKMode = enableAutoPerformanceTracking;
95
+ #endif
94
96
  }
95
97
 
96
98
  [SentrySDK startWithOptionsObject:sentryOptions];
97
99
 
100
+ #if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
101
+ BOOL appIsActive = [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive;
102
+ #else
103
+ BOOL appIsActive = [[NSApplication sharedApplication] isActive];
104
+ #endif
105
+
98
106
  // If the app is active/in foreground, and we have not sent the SentryHybridSdkDidBecomeActive notification, send it.
99
- if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive && !sentHybridSdkDidBecomeActive && sentryOptions.enableAutoSessionTracking) {
107
+ if (appIsActive && !sentHybridSdkDidBecomeActive && sentryOptions.enableAutoSessionTracking) {
100
108
  [[NSNotificationCenter defaultCenter]
101
109
  postNotificationName:@"SentryHybridSdkDidBecomeActive"
102
110
  object:nil];
@@ -164,9 +172,9 @@ RCT_EXPORT_METHOD(fetchNativeDeviceContexts:(RCTPromiseResolveBlock)resolve
164
172
  NSDictionary<NSString *, id> *serializedScope = [scope serialize];
165
173
  // Scope serializes as 'context' instead of 'contexts' as it does for the event.
166
174
  NSDictionary<NSString *, id> *tempContexts = [serializedScope valueForKey:@"context"];
167
-
175
+
168
176
  NSMutableDictionary<NSString *, id> *user = [NSMutableDictionary new];
169
-
177
+
170
178
  NSDictionary<NSString *, id> *tempUser = [serializedScope valueForKey:@"user"];
171
179
  if (tempUser != nil) {
172
180
  [user addEntriesFromDictionary:[tempUser valueForKey:@"user"]];
@@ -174,7 +182,7 @@ RCT_EXPORT_METHOD(fetchNativeDeviceContexts:(RCTPromiseResolveBlock)resolve
174
182
  [user setValue:PrivateSentrySDKOnly.installationID forKey:@"id"];
175
183
  }
176
184
  [contexts setValue:user forKey:@"user"];
177
-
185
+
178
186
  if (tempContexts != nil) {
179
187
  [contexts setValue:tempContexts forKey:@"context"];
180
188
  }
@@ -215,6 +223,7 @@ RCT_EXPORT_METHOD(fetchNativeFrames:(RCTPromiseResolveBlock)resolve
215
223
  rejecter:(RCTPromiseRejectBlock)reject)
216
224
  {
217
225
 
226
+ #if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
218
227
  if (PrivateSentrySDKOnly.isFramesTrackingRunning) {
219
228
  SentryScreenFrames *frames = PrivateSentrySDKOnly.currentScreenFrames;
220
229
 
@@ -241,6 +250,9 @@ RCT_EXPORT_METHOD(fetchNativeFrames:(RCTPromiseResolveBlock)resolve
241
250
  } else {
242
251
  resolve(nil);
243
252
  }
253
+ #else
254
+ resolve(nil);
255
+ #endif
244
256
  }
245
257
 
246
258
  RCT_EXPORT_METHOD(fetchNativeRelease:(RCTPromiseResolveBlock)resolve
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "3.4.2",
5
+ "version": "3.4.3",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",