@dynatrace/react-native-plugin 2.287.1 → 2.287.2

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/README.md CHANGED
@@ -1320,7 +1320,7 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
1320
1320
  <br/><br/>
1321
1321
  ## Changelog
1322
1322
 
1323
- 2.287.1
1323
+ 2.287.2
1324
1324
  * Update Android (8.287.1.1006) & iOS Agent (8.287.2.1009)
1325
1325
  * Added request and response size to [manual web request tagging](#manual-web-request-tagging)
1326
1326
 
@@ -5,19 +5,10 @@
5
5
  #ifndef DynatraceRNBridge_h
6
6
  #define DynatraceRNBridge_h
7
7
 
8
- @import Dynatrace;
9
-
10
- // For Turbo Module
11
- #ifdef RCT_NEW_ARCH_ENABLED
12
- #import "DynatraceBridgeSpec.h"
13
-
14
- @interface DynatraceRNBridge : NSObject <DynatraceBridgeSpec>
15
- // For Legacy Native Module
16
- #else
8
+ #import <Dynatrace/Dynatrace.h>
17
9
  #import <React/RCTBridgeModule.h>
18
10
 
19
11
  @interface DynatraceRNBridge : NSObject <RCTBridgeModule>
20
- #endif
21
12
  - (void) newAction:(NSString *)name key:(NSString *)key parentAction:(DTXAction *)parentAction;
22
13
  - (DTXAction *) getAction:(NSString *)key;
23
14
  - (BOOL) shouldWorkOnIosWithPlatform: (NSString *) platform;
@@ -26,6 +17,7 @@
26
17
  typedef enum : NSUInteger {
27
18
  DTXActionPlatformJavaScript = 1,
28
19
  DTXActionPlatformXamarin,
20
+ DTXActionPlatformCustom = 10
29
21
  } DTXActionPlatformType;
30
22
 
31
23
  @interface DTXAction (ExternalAgents)
@@ -1,5 +1,5 @@
1
1
  //
2
- // DynatraceRNBridge.m
2
+ // DynatraceRNBridge.mm
3
3
  //
4
4
 
5
5
  #import "DynatraceRNBridge.h"
@@ -168,7 +168,7 @@ RCT_EXPORT_METHOD(reportError:(NSString *)errorName errorValue:(NSString *)error
168
168
  {
169
169
  if ([self shouldWorkOnIosWithPlatform: platform])
170
170
  {
171
- [DTXAction reportExternalErrorForPlatformType:-1 errorName:errorName errorValue:errorValue reason:errorReason stacktrace:stacktrace];
171
+ [DTXAction reportExternalErrorForPlatformType:DTXActionPlatformCustom errorName:errorName errorValue:errorValue reason:errorReason stacktrace:stacktrace];
172
172
  }
173
173
  }
174
174
 
@@ -179,7 +179,7 @@ RCT_EXPORT_METHOD(reportCrash:(NSString *)errorName errorReason:(NSString *)erro
179
179
  if(isRealError){
180
180
  [DTXAction reportExternalCrashForPlatformType:DTXActionPlatformJavaScript crashName:errorName reason:errorReason stacktrace:stacktrace];
181
181
  }else{
182
- [DTXAction reportExternalCrashForPlatformType:-1 crashName:errorName reason:errorReason stacktrace:stacktrace];
182
+ [DTXAction reportExternalCrashForPlatformType:DTXActionPlatformCustom crashName:errorName reason:errorReason stacktrace:stacktrace];
183
183
  }
184
184
 
185
185
  // We ignore the newSession parameter and always end the session as the iOS agent has no troubles with this behavior
@@ -187,22 +187,24 @@ RCT_EXPORT_METHOD(reportCrash:(NSString *)errorName errorReason:(NSString *)erro
187
187
  }
188
188
  }
189
189
 
190
- RCT_EXPORT_METHOD(storeCrash:(NSString *)crashName reason:(NSString *)reason stacktrace:(NSString *)stacktrace platform:(NSString *) platform) {
191
- if ([self shouldWorkOnIosWithPlatform: platform])
192
- {
193
- NSString* dirPath = [[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] firstObject] path];
194
- dirPath = [dirPath stringByAppendingPathComponent:@"DTXExternalCrashes"];
195
- // Create the Application Support/DTXExternalCrashes directory if it does not exist
196
- if (![[NSFileManager defaultManager] fileExistsAtPath:dirPath]) {
197
- NSError *e;
198
- [[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:YES attributes:nil error:&e];
199
- NSAssert(e == nil, @"Couldn't create Application Support directory, %@", e.localizedDescription);
200
- }
201
- NSDictionary* crashDict = @{ @"crashName": crashName, @"reason": reason, @"stacktrace": stacktrace, @"technologyType": @"j" };
202
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:crashDict options:NSJSONWritingPrettyPrinted error:nil];
203
- NSString* crashJson= [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
204
- // Store react native crash
205
- [[NSFileManager defaultManager] createFileAtPath:[dirPath stringByAppendingPathComponent:@"RNCrash.txt"] contents:[crashJson dataUsingEncoding:NSUTF8StringEncoding] attributes:nil];
190
+ RCT_EXPORT_METHOD(storeCrash:(NSString *)crashName reason:(NSString *)reason stacktrace:(NSString *)stacktrace newSession:(BOOL)newSession) {
191
+ NSString* dirPath = [[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] firstObject] path];
192
+ dirPath = [dirPath stringByAppendingPathComponent:@"DTXExternalCrashes"];
193
+ // Create the Application Support/DTXExternalCrashes directory if it does not exist
194
+ if (![[NSFileManager defaultManager] fileExistsAtPath:dirPath]) {
195
+ NSError *e;
196
+ [[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:YES attributes:nil error:&e];
197
+ NSAssert(e == nil, @"Couldn't create Application Support directory, %@", e.localizedDescription);
198
+ }
199
+ NSDictionary* crashDict = @{ @"crashName": crashName, @"reason": reason, @"stacktrace": stacktrace, @"technologyType": @"j" };
200
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:crashDict options:NSJSONWritingPrettyPrinted error:nil];
201
+ NSString* crashJson= [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
202
+ // Store react native crash
203
+ [[NSFileManager defaultManager] createFileAtPath:[dirPath stringByAppendingPathComponent:@"RNCrash.txt"] contents:[crashJson dataUsingEncoding:NSUTF8StringEncoding] attributes:nil];
204
+
205
+ // Create a new session if the app is in debug mode or reloadOnFatalError value is set to true where the crash is caught and the app is not forced to shutdown
206
+ if (newSession) {
207
+ [Dynatrace endVisit];
206
208
  }
207
209
  }
208
210
 
@@ -265,17 +267,12 @@ RCT_EXPORT_METHOD(startWebRequestTiming:(NSString*) requestTag url:(NSString*) u
265
267
 
266
268
  }
267
269
 
268
- RCT_EXPORT_METHOD(stopWebRequestTiming:(NSString*) requestTag responseCode:(nonnull NSNumber*) responseCode responseMessage:(NSString*)responseMessage)
269
- {
270
- [self stopWebRequestTimingWithSize:requestTag responseCode:responseCode requestSize:-1 responseSize:-1];
271
- }
272
-
273
- RCT_EXPORT_METHOD(stopWebRequestTimingWithSize:(NSString*) requestTag responseCode:(nonnull NSNumber*) responseCode responseMessage:(NSString*)responseMessage requestSize:(nonnull NSNumber*) requestSize responseSize:(nonnull NSNumber*) responseSize)
270
+ RCT_EXPORT_METHOD(stopWebRequestTiming:(NSString*) requestTag url:(NSString*)url responseCode:(nonnull NSNumber*) responseCode responseMessage:(NSString*)responseMessage)
274
271
  {
275
272
  if(requestTag != NULL){
276
273
  DTXWebRequestTiming* timing = [webTimingsDict objectForKey:requestTag];
277
274
  if(timing){
278
- [timing stopWebRequestTiming:[responseCode stringValue] bytesSent:[requestSize longLongValue] bytesReceived:[responseSize longLongValue]];
275
+ [timing stopWebRequestTiming:[responseCode stringValue]];
279
276
  [webTimingsDict removeObjectForKey:requestTag];
280
277
  }
281
278
  }
@@ -372,19 +369,13 @@ RCT_EXPORT_METHOD(setDataCollectionLevel:(nonnull NSString *) dataCollectionLeve
372
369
  {
373
370
  if ([self shouldWorkOnIosWithPlatform: platform])
374
371
  {
375
- int dataCollectionLevelEnum;
376
-
377
372
  if([dataCollectionLevel isEqualToString: DataCollectionPerformance]){
378
- dataCollectionLevelEnum = DTX_DataCollectionPerformance;
373
+ [Dynatrace setDataCollectionLevel:DTX_DataCollectionPerformance completion:^(BOOL successful) {}];
379
374
  }else if([dataCollectionLevel isEqualToString: DataCollectionUserBehavior]){
380
- dataCollectionLevelEnum = DTX_DataCollectionUserBehavior;
375
+ [Dynatrace setDataCollectionLevel:DTX_DataCollectionUserBehavior completion:^(BOOL successful) {}];
381
376
  }else{
382
- dataCollectionLevelEnum = DTX_DataCollectionOff;
377
+ [Dynatrace setDataCollectionLevel:DTX_DataCollectionOff completion:^(BOOL successful) {}];
383
378
  }
384
-
385
- [Dynatrace setDataCollectionLevel:dataCollectionLevelEnum completion:^(BOOL successful) {
386
- // Do nothing - Not sure
387
- }];
388
379
  }
389
380
  }
390
381
 
@@ -482,7 +473,7 @@ RCT_EXPORT_METHOD(applyUserPrivacyOptions:(NSDictionary *) userPrivacyOptions pl
482
473
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
483
474
  (const facebook::react::ObjCTurboModule::InitParams &)params
484
475
  {
485
- return std::make_shared<facebook::react::<NativeDynatraceBridgeSpecJSI>>(params);
476
+ return std::make_shared<facebook::react::NativeDynatraceBridgeSpecJSI>(params);
486
477
  }
487
478
  #endif
488
479
 
@@ -7,9 +7,9 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 680D85DC2243B77D007953B5 /* DynatraceRNBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 680D85DB2243B77D007953B5 /* DynatraceRNBridge.m */; };
10
+ 680D85DC2243B77D007953B5 /* DynatraceRNBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 680D85DB2243B77D007953B5 /* DynatraceRNBridge.mm */; };
11
11
  68368004225F1139001BFE0F /* libDynatrace.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68FC4BE92243D05900C87820 /* libDynatrace.a */; };
12
- FE85101429BB606C0073625D /* DynatraceRNBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 680D85DB2243B77D007953B5 /* DynatraceRNBridge.m */; };
12
+ FE85101429BB606C0073625D /* DynatraceRNBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 680D85DB2243B77D007953B5 /* DynatraceRNBridge.mm */; };
13
13
  FE85101629BB606C0073625D /* libDynatrace.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68FC4BE92243D05900C87820 /* libDynatrace.a */; };
14
14
  /* End PBXBuildFile section */
15
15
 
@@ -37,7 +37,7 @@
37
37
  /* Begin PBXFileReference section */
38
38
  134814201AA4EA6300B7C361 /* libRNDynatrace.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNDynatrace.a; sourceTree = BUILT_PRODUCTS_DIR; };
39
39
  680D85DA2243B77D007953B5 /* DynatraceRNBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynatraceRNBridge.h; sourceTree = "<group>"; };
40
- 680D85DB2243B77D007953B5 /* DynatraceRNBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DynatraceRNBridge.m; sourceTree = "<group>"; };
40
+ 680D85DB2243B77D007953B5 /* DynatraceRNBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DynatraceRNBridge.mm; sourceTree = "<group>"; };
41
41
  68FC4BE92243D05900C87820 /* libDynatrace.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libDynatrace.a; path = lib/libDynatrace.a; sourceTree = "<group>"; };
42
42
  68FC4BEA2243D05900C87820 /* Dynatrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Dynatrace.h; path = lib/Dynatrace.h; sourceTree = "<group>"; };
43
43
  FE85101B29BB606C0073625D /* libRNDynatrace-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRNDynatrace-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -77,7 +77,7 @@
77
77
  134814211AA4EA7D00B7C361 /* Products */,
78
78
  FE85101B29BB606C0073625D /* libRNDynatrace-tvOS.a */,
79
79
  680D85DA2243B77D007953B5 /* DynatraceRNBridge.h */,
80
- 680D85DB2243B77D007953B5 /* DynatraceRNBridge.m */,
80
+ 680D85DB2243B77D007953B5 /* DynatraceRNBridge.mm */,
81
81
  680D868C2243CCA0007953B5 /* Frameworks */,
82
82
  );
83
83
  sourceTree = "<group>";
@@ -166,7 +166,7 @@
166
166
  isa = PBXSourcesBuildPhase;
167
167
  buildActionMask = 2147483647;
168
168
  files = (
169
- 680D85DC2243B77D007953B5 /* DynatraceRNBridge.m in Sources */,
169
+ 680D85DC2243B77D007953B5 /* DynatraceRNBridge.mm in Sources */,
170
170
  );
171
171
  runOnlyForDeploymentPostprocessing = 0;
172
172
  };
@@ -174,7 +174,7 @@
174
174
  isa = PBXSourcesBuildPhase;
175
175
  buildActionMask = 2147483647;
176
176
  files = (
177
- FE85101429BB606C0073625D /* DynatraceRNBridge.m in Sources */,
177
+ FE85101429BB606C0073625D /* DynatraceRNBridge.mm in Sources */,
178
178
  );
179
179
  runOnlyForDeploymentPostprocessing = 0;
180
180
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/react-native-plugin",
3
- "version": "2.287.1",
3
+ "version": "2.287.2",
4
4
  "description": "This plugin gives you the ability to use the Dynatrace Mobile agent in your react native application.",
5
5
  "main": "index.js",
6
6
  "types": "typings/react-native-dynatrace.d.ts",
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
14
14
  s.homepage = package['homepage']
15
15
  s.ios.deployment_target = "12.0"
16
16
  s.tvos.deployment_target = "12.0"
17
- s.source_files = ["ios/*.{h,m}","ios/lib/*.h"]
17
+ s.source_files = ["ios/*.{h,mm}"]
18
18
 
19
19
  s.license = { :type => 'Commercial', :text => 'https://github.com/Dynatrace/dem-license/blob/main/LICENSE.md'}
20
20