@dynatrace/react-native-plugin 2.255.1 → 2.257.1

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.
Files changed (88) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +41 -16
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridge.java +74 -21
  5. package/files/plugin.gradle +1 -1
  6. package/ios/DynatraceRNBridge.h +2 -2
  7. package/ios/DynatraceRNBridge.m +38 -17
  8. package/ios/lib/Dynatrace.xcframework/Info.plist +10 -10
  9. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Dynatrace +0 -0
  10. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Headers/Dynatrace-Swift.h +46 -1
  11. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Headers/Dynatrace.h +3 -3
  12. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Info.plist +0 -0
  13. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  14. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.abi.json +21 -0
  15. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.private.swiftinterface +9 -0
  16. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  17. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.swiftinterface +4 -2
  18. package/ios/lib/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/module.modulemap +2 -2
  19. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  20. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace-Swift.h +82 -2
  21. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +3 -3
  22. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  23. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  24. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  25. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.abi.json +21 -0
  26. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +9 -0
  27. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  28. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -2
  29. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.abi.json +21 -0
  30. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +9 -0
  31. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  32. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +4 -2
  33. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +2 -2
  34. package/ios/lib/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +61 -65
  35. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Dynatrace +0 -0
  36. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Dynatrace-Swift.h +46 -1
  37. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Dynatrace.h +3 -3
  38. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Info.plist +0 -0
  39. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo +0 -0
  40. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos.abi.json +21 -0
  41. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos.private.swiftinterface +9 -0
  42. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos.swiftdoc +0 -0
  43. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos.swiftinterface +3 -1
  44. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/module.modulemap +2 -2
  45. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  46. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace-Swift.h +82 -2
  47. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +3 -3
  48. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  49. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo +0 -0
  50. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo +0 -0
  51. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.abi.json +21 -0
  52. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.private.swiftinterface +9 -0
  53. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.swiftdoc +0 -0
  54. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.swiftinterface +3 -1
  55. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.abi.json +21 -0
  56. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.private.swiftinterface +9 -0
  57. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.swiftdoc +0 -0
  58. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface +3 -1
  59. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +2 -2
  60. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +67 -23
  61. package/lib/instrumentor/DynatraceInstrumentation.js +1 -1
  62. package/lib/instrumentor/base/Dynatrace.js +48 -31
  63. package/lib/instrumentor/base/DynatraceAction.js +44 -0
  64. package/lib/instrumentor/base/DynatraceInternal.js +25 -0
  65. package/lib/instrumentor/base/DynatraceRootAction.js +38 -0
  66. package/lib/instrumentor/base/DynatraceWebRequestTiming.js +37 -0
  67. package/lib/instrumentor/base/ElementHelper.js +3 -2
  68. package/lib/instrumentor/base/ErrorHandler.js +2 -1
  69. package/lib/instrumentor/base/NullAction.js +8 -0
  70. package/lib/instrumentor/base/NullRootAction.js +10 -0
  71. package/lib/instrumentor/base/NullWebRequestTiming.js +15 -0
  72. package/lib/instrumentor/base/Picker.js +1 -1
  73. package/lib/instrumentor/base/RefreshControl.js +1 -1
  74. package/lib/instrumentor/base/Touchable.js +11 -7
  75. package/lib/instrumentor/base/configuration/AutoStartupConfiguration.js +4 -0
  76. package/lib/instrumentor/base/configuration/Configuration.js +1 -0
  77. package/lib/instrumentor/base/configuration/ConfigurationDefaults.js +4 -2
  78. package/lib/instrumentor/base/configuration/ManualStartupConfiguration.js +5 -5
  79. package/lib/instrumentor/base/{interface → configuration/interface}/IAutoConfiguration.js +0 -0
  80. package/lib/instrumentor/base/configuration/interface/IManualConfiguration.js +3 -0
  81. package/lib/instrumentor/base/interface/IDynatraceInternal.js +2 -0
  82. package/lib/instrumentor/base/interface/IDynatraceRootAction.js +2 -0
  83. package/lib/instrumentor/base/interface/IWebRequestTiming.js +1 -0
  84. package/lib/instrumentor/base/util/StringUtils.js +1 -0
  85. package/lib/react/Component.js +3 -3
  86. package/package.json +5 -3
  87. package/react-native-dynatrace.podspec +3 -2
  88. package/typings/react-native-dynatrace.d.ts +242 -110
package/LICENSE.md ADDED
@@ -0,0 +1 @@
1
+ [Authorized Dynatrace Customer Subscription Agreement](https://github.com/Dynatrace/dem-license/blob/main/LICENSE.md)
package/README.md CHANGED
@@ -23,20 +23,21 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
23
23
  * SDK version 21+
24
24
  * Gradle version 6.1.1+ ([How to update?](#updating-to-gradle-6))
25
25
  * Android Gradle plugin version 4.0+
26
- * For iOS users: Minimum iOS 9
26
+ * For iOS users: Minimum iOS 11
27
27
 
28
28
  ## Agent Versions
29
29
  This agent versions are configured in this plugin:
30
30
 
31
- * iOS Agent: 8.255.1.1006
32
- * Android Agent: 8.255.1.1005
31
+ * iOS Agent: 8.257.1.1007
32
+ * Android Agent: 8.257.1.1007
33
33
 
34
34
  ## Quick Setup
35
35
 
36
36
  1. [Install plugin](#1-install-the-plugin)
37
37
  2. [Register Dynatrace transformer](#2-register-the-dynatrace-transformer)
38
38
  3. [Setup configuration](#3-setup-dynatraceconfigjs)
39
- 4. [Build and run your app](#4-build-and-run-your-app)
39
+ 4. [Update Babel Configuration](#4-update-babel-configuration)
40
+ 5. [Build and run your app](#4-build-and-run-your-app)
40
41
 
41
42
  ## Advanced topics
42
43
  * [Manual OneAgent Startup](#manual-oneagent-startup)
@@ -132,7 +133,7 @@ Depending on your version of Metro or Expo (if used), your babel configuration `
132
133
  The changes have to be done in the following cases:
133
134
 
134
135
  - metro >= 0.72.0: https://github.com/facebook/metro/releases/tag/v0.72.0
135
- - expo >= 0.44.0 or babel-preset-expo >= 9.0.0: https://github.com/expo/expo/blob/main/packages/babel-preset-expo/CHANGELOG.md#900--2021-12-03
136
+ - expo >= 44.0.0 or babel-preset-expo >= 9.0.0: https://github.com/expo/expo/blob/main/packages/babel-preset-expo/CHANGELOG.md#900--2021-12-03
136
137
 
137
138
  The required changes for the versions above can be found [here](#react-automatic-runtime).
138
139
 
@@ -215,21 +216,24 @@ new ManualStartupConfiguration(
215
216
  reportCrash: true,
216
217
  logLevel: LogLevel.Info,
217
218
  lifecycleUpdate: false,
218
- certificateValidation: true;
219
- userOptIn: false;
219
+ userOptIn: false,
220
+ actionNamePrivacy: false,
221
+ bundleName: undefined
220
222
  )
221
223
  ```
222
224
 
223
225
  | Property name | Type | Default | Description |
224
226
  |------------------|--------|-------------|---------------------------------------------------|
225
- |beaconUrl |string |null |Identifies your environment within Dynatrace. This property is mandatory for [manual startup](#manual-oneagent-startup). OneAgent issues an error when the key isn't present.|
226
- |applicationId |string |null |Identifies your mobile app. This property is mandatory for [manual startup](#manual-oneagent-startup). OneAgent issues an error when the key isn't present.|
227
+ |beaconUrl |string |undefined |Identifies your environment within Dynatrace. This property is mandatory for [manual startup](#manual-oneagent-startup). OneAgent issues an error when the key isn't present.|
228
+ |applicationId |string |undefined |Identifies your mobile app. This property is mandatory for [manual startup](#manual-oneagent-startup). OneAgent issues an error when the key isn't present.|
227
229
  |reportCrash |boolean |true |Reports crashes. |
228
230
  |logLevel |LogLevel|LogLevel.Info|Allows you to choose between `LogLevel.Info` and `LogLevel.Debug`. Debug returns more logs. This is especially important when something is not functioning correctly.|
229
231
  |lifecycleUpdate |boolean |false |Decide if you want to see update cycles on lifecycle actions as well. This is per default false as it creates a lot more actions.|
230
- |certificateValidation|boolean |true |Allows the use of self-signed certificates. By default, it is set to false. When set to true, OneAgent accepts self-signed certificates that are not signed by a root-CA. This configuration key doesn't impact mobile app connections. It's only used for OneAgent communication, but doesn't overrule the host-name validation.|
231
232
  |userOptIn |boolean |false |Activates the privacy mode when set to `true`. User consent must be queried and set. The privacy settings for [data collection](#data-collection) and [crash reporting](#crash-reporting) can be changed via OneAgent SDK for Mobile as described under Data privacy. The default value is `false`.|
232
233
  |actionNamePrivacy|boolean|false|Activates a privacy mode especially for Touchables and Buttons. Setting this option to true means that a name for the control will no longer be shown, e.g. "Touch on Button". When setting a dtActionName onto the component this setting will be ignored.
234
+ |bundleName|string|undefined|Should be used only if you have a multiple bundle setup where you load several .bundle files within your React Native application. Enter the name of your bundle. This should be unique in comparison to your other bundle names. This will ensure that actions coming from different bundles will not interfere with each other.
235
+
236
+
233
237
 
234
238
  **Note**: The values used for the parameters are their default value.
235
239
 
@@ -255,10 +259,15 @@ Combining manual and auto instrumentation is not creating a problem as both are
255
259
 
256
260
  ### Create custom actions
257
261
 
262
+ There are two options to create an action. Either using `enterAutoAction` (the previous `enterAction`) or `enterManualAction`:
263
+
264
+ * `enterAutoAction` - Creates an Action which will be automatically handled by the plugin (This is the type of action which is internally used by the plugin when monitoring components and touchables). This means that the plugin decides about the hierachy of this action. If there is no open action, the following action will be a root action. All other actions created by this method, while a root action is open, will be automatically inserted as a child action. Furthermore the plugin will automatically link webrequest (if they are not tagged manually) to the open root action.
265
+ * `enterManualAction` - Creates an Action which will NOT be handled by the plugin. This means that you have full control about the hierachy of your actions. This function will create a root action for you, which has the ability to create child actions via `enterAction`. Be aware, because of the full manual approach the plugin will not link webrequest automatically. Webrequest have to be manually tagged by using the tag provided by the action via `getRequestTag`.
266
+
258
267
  To create a custom action named `"MyButton tapped"`, use the following code. The *leaveAction* closes the action again. To report values for this action before closing, see [Report Values](#report-values).
259
268
 
260
269
  ```js
261
- let myAction = Dynatrace.enterAction("MyButton tapped");
270
+ let myAction = Dynatrace.enterManualAction("MyButton tapped");
262
271
  //Perform the action and whatever else is needed.
263
272
  myAction.leaveAction();
264
273
  ```
@@ -601,14 +610,14 @@ Here is a list of all the counterparts for the options that can be used with a m
601
610
 
602
611
  | Property Name | Default | Android | iOS | React |
603
612
  |---------------|------|---------|-------------|-------------|
604
- |beaconUrl|null|autoStart.beaconUrl|DTXBeaconURL| - |
605
- |applicationId|null|autoStart.applicationId|DTXApplicationId| - |
613
+ |beaconUrl|undefined|autoStart.beaconUrl|DTXBeaconURL| - |
614
+ |applicationId|undefined|autoStart.applicationId|DTXApplicationId| - |
606
615
  |reportCrash|true|crashReporting|DTXCrashReporting| - |
607
616
  |logLevel|LogLevel.Info|debug.agentLogging|DTXLogLevel| debug |
608
617
  |lifecycleUpdate|false| - | - | lifecycle.includeUpdate |
609
- |certificateValidation|false|debug.certificateValidation|DTXAllowAnyCert| - |
610
618
  |userOptIn|false|userOptIn|DTXUserOptIn| - |
611
619
  |actionNamePrivacy|false|-|-|input.actionNamePrivacy
620
+ |bundleName|undefined|-|-|bundleName
612
621
 
613
622
  ### React block
614
623
 
@@ -668,6 +677,16 @@ react: {
668
677
 
669
678
  This activates the AutoStart mode, which will insert an auto start call in your React Native application. This is per default true. If you want to use a manual startup call, please have a look into the [manual startup section](#manual-oneagent-startup).
670
679
 
680
+ #### Bundle Name
681
+
682
+ Should be used only if you have a multiple bundle setup where you load several .bundle files within your React Native application. Enter the name of your bundle. This should be unique in comparison to your other bundle names. This will ensure that actions coming from different bundles will not interfere with each other.
683
+
684
+ ```js
685
+ react: {
686
+ bundleName: "MyCustomBundle"
687
+ }
688
+ ```
689
+
671
690
  ### Android block
672
691
 
673
692
  The Android block is a wrapper for the Android configuration you find in the WebUI (in the Mobile Application Settings). Copy the content into the following block:
@@ -891,7 +910,7 @@ module.exports = {
891
910
  }
892
911
  ```
893
912
 
894
- Using `babel-expo-preset`:
913
+ Using `babel-preset-expo`:
895
914
 
896
915
  ```js
897
916
  module.exports = {
@@ -1078,7 +1097,13 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
1078
1097
  <br/><br/>
1079
1098
  ## Changelog
1080
1099
 
1081
- 2.555.1
1100
+ 2.257.1
1101
+ * Added API for creating a [manual custom action](#create-custom-actions)
1102
+ * Removed option to disable certificate validation
1103
+ * Updated Android (8.257.1.1007) & iOS Agent (8.257.1.1007)
1104
+ * Minimum Support iOS version raised to 11
1105
+
1106
+ 2.255.1
1082
1107
  * Enhanced debug logging
1083
1108
  * Adding instrumentation for touchables of react-native-gesture-handler
1084
1109
  * Fixed Auto instrumentation in case of missing start of plugin
@@ -36,7 +36,7 @@ repositories {
36
36
  }
37
37
 
38
38
  dependencies {
39
- implementation 'com.dynatrace.agent:agent-android:8.255.1.1005'
39
+ implementation 'com.dynatrace.agent:agent-android:8.257.1.1007'
40
40
  implementation "com.facebook.react:react-native:${safeExtGet('reactNative', '+')}"
41
41
  }
42
42
 
@@ -11,9 +11,9 @@ import com.facebook.react.bridge.Arguments;
11
11
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
12
12
  import com.facebook.react.bridge.ReactApplicationContext;
13
13
  import com.facebook.react.bridge.ReactMethod;
14
- import com.facebook.react.bridge.ReadableMap;
15
14
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
16
15
 
16
+ import java.net.MalformedURLException;
17
17
  import java.util.Hashtable;
18
18
  import java.util.HashMap;
19
19
  import java.util.Map;
@@ -27,7 +27,8 @@ import com.dynatrace.android.agent.conf.UserPrivacyOptions;
27
27
 
28
28
  public class DynatraceRNBridge extends ReactContextBaseJavaModule {
29
29
 
30
- private Hashtable<Integer, DTXAction> actions;
30
+ private HashMap<String, WebRequestTiming> webTimings;
31
+ private HashMap<String, DTXAction> actions;
31
32
  private static final String PLATFORM_ANDROID = "android";
32
33
  private static final String PLATFORM_IOS = "ios";
33
34
  private static final String DATA_COLLECTION_OFF = "OFF";
@@ -38,7 +39,8 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
38
39
 
39
40
  public DynatraceRNBridge(ReactApplicationContext reactContext, PrivateDTBridge internal) {
40
41
  super(reactContext);
41
- actions = new Hashtable<>();
42
+ webTimings = new HashMap<>();
43
+ actions = new HashMap<>();
42
44
  _internal = internal;
43
45
  }
44
46
 
@@ -74,7 +76,6 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
74
76
  builder.withCrashReporting(configuration.getBoolean("reportCrash"));
75
77
  // 0 == Debug / 1 == Info
76
78
  builder.withDebugLogging(configuration.getInt("logLevel") == 0);
77
- builder.withCertificateValidation(configuration.getBoolean("certificateValidation"));
78
79
 
79
80
  Dynatrace.startup(getReactApplicationContext(), builder.buildConfiguration());
80
81
  }
@@ -84,7 +85,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
84
85
  // Expects a key which is generated in JS. This is to circumvent the async callback system.
85
86
  //
86
87
  @ReactMethod
87
- public void enterAction(String name, int key, String platform) {
88
+ public void enterAction(String name, String key, String platform) {
88
89
  if (this.shouldWorkOnAndroid(platform)) {
89
90
  try {
90
91
  newAction(name, key);
@@ -94,7 +95,26 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
94
95
  }
95
96
 
96
97
  @ReactMethod
97
- public void leaveAction(int key, String platform) {
98
+ public void enterManualAction(String name, String key, String platform) {
99
+ if (this.shouldWorkOnAndroid(platform)) {
100
+ actions.put(key, Dynatrace.enterAction(name));
101
+ }
102
+ }
103
+
104
+ private void enterManualActionWithParent(String name, String key, int parentKey, String platform) {
105
+ if (this.shouldWorkOnAndroid(platform)) {
106
+ DTXAction parent = actions.get(parentKey);
107
+
108
+ if (parent != null) {
109
+ actions.put(key, Dynatrace.enterAction(name, parent));
110
+ } else {
111
+ enterAction(name, key, platform);
112
+ }
113
+ }
114
+ }
115
+
116
+ @ReactMethod
117
+ public void leaveAction(String key, String platform) {
98
118
  if (this.shouldWorkOnAndroid(platform)) {
99
119
  DTXAction action = getAction(key);
100
120
  if (action == null) return;
@@ -104,17 +124,17 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
104
124
  action.leaveAction();
105
125
  }
106
126
 
107
- actions.remove(Integer.valueOf(key));
127
+ actions.remove(key);
108
128
  }
109
129
  }
110
130
 
111
131
  @ReactMethod
112
- public void cancelAction(int key, String platform) {
132
+ public void cancelAction(String key, String platform) {
113
133
  if (this.shouldWorkOnAndroid(platform)) {
114
134
  DTXAction action = getAction(key);
115
135
  if (action == null) return;
116
136
  action.cancel();
117
- actions.remove(Integer.valueOf(key));
137
+ actions.remove(key);
118
138
  }
119
139
  }
120
140
 
@@ -156,7 +176,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
156
176
  }
157
177
 
158
178
  @ReactMethod
159
- public void reportErrorInAction(int key, String errorName, int errorCode, String platform) {
179
+ public void reportErrorInAction(String key, String errorName, int errorCode, String platform) {
160
180
  if (this.shouldWorkOnAndroid(platform)) {
161
181
  DTXAction action = getAction(key);
162
182
  if (action == null) return;
@@ -165,7 +185,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
165
185
  }
166
186
 
167
187
  @ReactMethod
168
- public void reportValue(int key, String valueName, String value, String platform) {
188
+ public void reportValue(String key, String valueName, String value, String platform) {
169
189
  if (this.shouldWorkOnAndroid(platform)) {
170
190
  DTXAction action = getAction(key);
171
191
  if (action == null) return;
@@ -174,8 +194,41 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
174
194
  }
175
195
 
176
196
  @ReactMethod
177
- public void getRequestTag(Promise promise){
178
- promise.resolve(Dynatrace.getRequestTag());
197
+ public void getRequestTag(String key, String url, Promise promise){
198
+ DTXAction action = getAction(key);
199
+
200
+ if (action == null){
201
+ promise.resolve(Dynatrace.getRequestTag());
202
+ return;
203
+ };
204
+
205
+ promise.resolve(action.getRequestTag());
206
+ }
207
+
208
+ @ReactMethod
209
+ public void startWebRequestTiming(String requestTag, String url) {
210
+ if (requestTag != null) {
211
+ WebRequestTiming timing = Dynatrace.getWebRequestTiming(requestTag);
212
+ if(timing != null){
213
+ webTimings.put(requestTag, timing);
214
+ timing.startWebRequestTiming();
215
+ }
216
+ }
217
+ }
218
+
219
+ @ReactMethod
220
+ public void stopWebRequestTiming(String requestTag, String url, int responseCode, String responseMessage) {
221
+ if (requestTag != null) {
222
+ WebRequestTiming timing = webTimings.get(requestTag);
223
+ if (timing != null) {
224
+ try {
225
+ timing.stopWebRequestTiming(url, responseCode, responseMessage);
226
+ webTimings.remove(requestTag);
227
+ } catch (MalformedURLException ex) {
228
+ // do nothing
229
+ }
230
+ }
231
+ }
179
232
  }
180
233
 
181
234
  @ReactMethod
@@ -186,7 +239,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
186
239
  }
187
240
 
188
241
  @ReactMethod
189
- public void reportEventInAction(int actionKey, String name, String platform) {
242
+ public void reportEventInAction(String actionKey, String name, String platform) {
190
243
  if (this.shouldWorkOnAndroid(platform)) {
191
244
  DTXAction action = getAction(actionKey);
192
245
  if (action == null) return;
@@ -195,7 +248,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
195
248
  }
196
249
 
197
250
  @ReactMethod
198
- public void reportStringValueInAction(int actionKey, String name, String value, String platform) {
251
+ public void reportStringValueInAction(String actionKey, String name, String value, String platform) {
199
252
  if (this.shouldWorkOnAndroid(platform)) {
200
253
  DTXAction action = getAction(actionKey);
201
254
  if (action == null) return;
@@ -204,7 +257,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
204
257
  }
205
258
 
206
259
  @ReactMethod
207
- public void reportIntValueInAction(int actionKey, String name, int value, String platform) {
260
+ public void reportIntValueInAction(String actionKey, String name, int value, String platform) {
208
261
  if (this.shouldWorkOnAndroid(platform)) {
209
262
  DTXAction action = getAction(actionKey);
210
263
  if (action == null) return;
@@ -213,7 +266,7 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
213
266
  }
214
267
 
215
268
  @ReactMethod
216
- public void reportDoubleValueInAction(int actionKey, String name, double value, String platform) {
269
+ public void reportDoubleValueInAction(String actionKey, String name, double value, String platform) {
217
270
  if (this.shouldWorkOnAndroid(platform)) {
218
271
  DTXAction action = getAction(actionKey);
219
272
  if (action == null) return;
@@ -322,13 +375,13 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
322
375
  }
323
376
  }
324
377
 
325
- private void newAction(String name, int key) throws Exception {
378
+ private void newAction(String name, String key) throws Exception {
326
379
  if (name == null) throw new Exception("action name is null");
327
- actions.put(Integer.valueOf(key), _internal.enterAction(name));
380
+ actions.put(key, _internal.enterAction(name));
328
381
  }
329
382
 
330
- private DTXAction getAction(int key){
331
- return actions.get(Integer.valueOf(key));
383
+ private DTXAction getAction(String key){
384
+ return actions.get(key);
332
385
  }
333
386
 
334
387
  private Boolean shouldWorkOnAndroid(String platform) {
@@ -1,3 +1,3 @@
1
1
  dependencies {
2
- classpath 'com.dynatrace.tools.android:gradle-plugin:8.255.1.1005'
2
+ classpath 'com.dynatrace.tools.android:gradle-plugin:8.257.1.1007'
3
3
  }
@@ -10,8 +10,8 @@
10
10
 
11
11
 
12
12
  @interface DynatraceRNBridge : NSObject <RCTBridgeModule>
13
- - (void) newAction:(NSString *)name key:(NSNumber *)key parentAction:(DTXAction *)parentAction;
14
- - (DTXAction *) getAction:(NSNumber *)key;
13
+ - (void) newAction:(NSString *)name key:(NSString *)key parentAction:(DTXAction *)parentAction;
14
+ - (DTXAction *) getAction:(NSString *)key;
15
15
  - (BOOL) shouldWorkOnIosWithPlatform: (NSString *) platform;
16
16
  @end
17
17
 
@@ -9,6 +9,7 @@
9
9
  @implementation DynatraceRNBridge
10
10
 
11
11
  NSMutableDictionary *actionDict;
12
+ NSMutableDictionary *webTimingsDict;
12
13
 
13
14
  NSString *const PlatformAndroid = @"android";
14
15
  NSString *const PlatformiOS = @"ios";
@@ -23,6 +24,7 @@ RCT_EXPORT_MODULE(DynatraceBridge);
23
24
  self = [super init];
24
25
  if (self) {
25
26
  actionDict = [[NSMutableDictionary alloc] init];
27
+ webTimingsDict = [[NSMutableDictionary alloc] init];
26
28
  }
27
29
  return self;
28
30
  }
@@ -64,16 +66,12 @@ RCT_EXPORT_METHOD(start:(NSDictionary *) options)
64
66
  properties[@"DTXLogLevel"] = @"ALL";
65
67
  }
66
68
 
67
- if (options[@"certificateValidation"] != NULL && [[options valueForKey:@"certificateValidation"] isEqual: @(NO)]) {
68
- properties[@"DTXAllowAnyCert"] = @YES;
69
- }
70
-
71
69
  if (properties[@"DTXBeaconURL"] != NULL && properties[@"DTXApplicationID"] != NULL) {
72
70
  [Dynatrace startupWithConfig:properties];
73
71
  }
74
72
  }
75
73
 
76
- RCT_EXPORT_METHOD(enterAction:(NSString *)name key:(nonnull NSNumber *)key platform: (NSString *) platform)
74
+ RCT_EXPORT_METHOD(enterAction:(NSString *)name key:(nonnull NSString *)key platform: (NSString *) platform)
77
75
  {
78
76
  if ([self shouldWorkOnIosWithPlatform: platform])
79
77
  {
@@ -81,7 +79,7 @@ RCT_EXPORT_METHOD(enterAction:(NSString *)name key:(nonnull NSNumber *)key platf
81
79
  }
82
80
  }
83
81
 
84
- RCT_EXPORT_METHOD(enterActionWithParent:(NSString *)name key:(nonnull NSNumber *)key parentKey:(nonnull NSNumber *)parentKey platform: (NSString *) platform)
82
+ RCT_EXPORT_METHOD(enterActionWithParent:(NSString *)name key:(nonnull NSString *)key parentKey:(nonnull NSString *)parentKey platform: (NSString *) platform)
85
83
  {
86
84
  if ([self shouldWorkOnIosWithPlatform: platform])
87
85
  {
@@ -89,7 +87,7 @@ RCT_EXPORT_METHOD(enterActionWithParent:(NSString *)name key:(nonnull NSNumber *
89
87
  }
90
88
  }
91
89
 
92
- RCT_EXPORT_METHOD(leaveAction:(nonnull NSNumber *)key platform: (NSString *) platform)
90
+ RCT_EXPORT_METHOD(leaveAction:(nonnull NSString *)key platform: (NSString *) platform)
93
91
  {
94
92
  if ([self shouldWorkOnIosWithPlatform: platform])
95
93
  {
@@ -99,7 +97,7 @@ RCT_EXPORT_METHOD(leaveAction:(nonnull NSNumber *)key platform: (NSString *) pla
99
97
  }
100
98
  }
101
99
 
102
- RCT_EXPORT_METHOD(cancelAction:(nonnull NSNumber *)key platform: (NSString *) platform)
100
+ RCT_EXPORT_METHOD(cancelAction:(nonnull NSString *)key platform: (NSString *) platform)
103
101
  {
104
102
  if ([self shouldWorkOnIosWithPlatform: platform])
105
103
  {
@@ -150,7 +148,7 @@ RCT_EXPORT_METHOD(reportCrash:(NSString *)errorName errorReason:(NSString *)erro
150
148
  }
151
149
  }
152
150
 
153
- RCT_EXPORT_METHOD(reportErrorInAction:(nonnull NSNumber *)key errorName:(NSString *)errorName errorCode:(nonnull NSNumber *)errorCode platform: (NSString *) platform)
151
+ RCT_EXPORT_METHOD(reportErrorInAction:(nonnull NSString *)key errorName:(NSString *)errorName errorCode:(nonnull NSNumber *)errorCode platform: (NSString *) platform)
154
152
  {
155
153
  if ([self shouldWorkOnIosWithPlatform: platform])
156
154
  {
@@ -161,7 +159,7 @@ RCT_EXPORT_METHOD(reportErrorInAction:(nonnull NSNumber *)key errorName:(NSStrin
161
159
  }
162
160
  }
163
161
 
164
- RCT_EXPORT_METHOD(reportStringValueInAction:(nonnull NSNumber *)actionKey withName:(NSString *)name value: (NSString *)value platform: (NSString *) platform)
162
+ RCT_EXPORT_METHOD(reportStringValueInAction:(nonnull NSString *)actionKey withName:(NSString *)name value: (NSString *)value platform: (NSString *) platform)
165
163
  {
166
164
  if ([self shouldWorkOnIosWithPlatform: platform])
167
165
  {
@@ -171,7 +169,7 @@ RCT_EXPORT_METHOD(reportStringValueInAction:(nonnull NSNumber *)actionKey withNa
171
169
  }
172
170
  }
173
171
 
174
- RCT_EXPORT_METHOD(reportIntValueInAction:(nonnull NSNumber *)actionKey withName:(NSString *)name value: (nonnull NSNumber *)value platform: (NSString *) platform)
172
+ RCT_EXPORT_METHOD(reportIntValueInAction:(nonnull NSString *)actionKey withName:(NSString *)name value: (nonnull NSNumber *)value platform: (NSString *) platform)
175
173
  {
176
174
  if ([self shouldWorkOnIosWithPlatform: platform])
177
175
  {
@@ -181,7 +179,7 @@ RCT_EXPORT_METHOD(reportIntValueInAction:(nonnull NSNumber *)actionKey withName:
181
179
  }
182
180
  }
183
181
 
184
- RCT_EXPORT_METHOD(reportDoubleValueInAction:(nonnull NSNumber *)actionKey withName:(NSString *)name value: (nonnull NSNumber *)value platform: (NSString *) platform)
182
+ RCT_EXPORT_METHOD(reportDoubleValueInAction:(nonnull NSString *)actionKey withName:(NSString *)name value: (nonnull NSNumber *)value platform: (NSString *) platform)
185
183
  {
186
184
  if ([self shouldWorkOnIosWithPlatform: platform])
187
185
  {
@@ -191,9 +189,32 @@ RCT_EXPORT_METHOD(reportDoubleValueInAction:(nonnull NSNumber *)actionKey withNa
191
189
  }
192
190
  }
193
191
 
194
- RCT_REMAP_METHOD(getRequestTag, getRequestTagWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
192
+ RCT_EXPORT_METHOD(getRequestTag:(nonnull NSNumber *)actionKey withUrl:(NSString *)url getRequestTagWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
193
+ {
194
+ DTXAction* action = [self getAction:actionKey];
195
+ resolve([action getTagForURL:[NSURL URLWithString:url]]);
196
+ }
197
+
198
+ RCT_EXPORT_METHOD(startWebRequestTiming:(NSString*) requestTag url:(NSString*) url)
199
+ {
200
+ if(requestTag != NULL && url != NULL){
201
+ DTXWebRequestTiming* timing = [DTXWebRequestTiming getDTXWebRequestTiming:requestTag requestUrl:[NSURL URLWithString:url]];
202
+ if (timing != NULL) {
203
+ [webTimingsDict setObject:timing forKey:[NSString stringWithString:requestTag]];
204
+ [timing startWebRequestTiming];
205
+ }
206
+ }
207
+ }
208
+
209
+ RCT_EXPORT_METHOD(stopWebRequestTiming:(NSString*) requestTag url:(NSString*)url responseCode:(nonnull NSNumber*) responseCode responseMessage:(NSString*)responseMessage)
195
210
  {
196
- resolve([Dynatrace getRequestTagValueForURL:nil]);
211
+ if(requestTag != NULL){
212
+ DTXWebRequestTiming* timing = [webTimingsDict objectForKey:requestTag];
213
+ if(timing){
214
+ [timing stopWebRequestTiming:[responseCode stringValue]];
215
+ [webTimingsDict removeObjectForKey:requestTag];
216
+ }
217
+ }
197
218
  }
198
219
 
199
220
  RCT_EXPORT_METHOD(identifyUser:(NSString *)user platform: (NSString *) platform)
@@ -204,7 +225,7 @@ RCT_EXPORT_METHOD(identifyUser:(NSString *)user platform: (NSString *) platform)
204
225
  }
205
226
  }
206
227
 
207
- RCT_EXPORT_METHOD(reportEventInAction:(nonnull NSNumber *)actionKey withName: (NSString *)name platform: (NSString *) platform)
228
+ RCT_EXPORT_METHOD(reportEventInAction:(nonnull NSString *)actionKey withName: (NSString *)name platform: (NSString *) platform)
208
229
  {
209
230
  if ([self shouldWorkOnIosWithPlatform: platform])
210
231
  {
@@ -366,7 +387,7 @@ RCT_EXPORT_METHOD(applyUserPrivacyOptions:(NSDictionary *) userPrivacyOptions pl
366
387
  }
367
388
  }
368
389
 
369
- - (void) newAction:(NSString *)name key:(nonnull NSNumber *)key parentAction:(DTXAction *)parentAction
390
+ - (void) newAction:(NSString *)name key:(nonnull NSString *)key parentAction:(DTXAction *)parentAction
370
391
  {
371
392
  DTXAction *action = [DTXAction integrateActionWithName:name];
372
393
 
@@ -376,7 +397,7 @@ RCT_EXPORT_METHOD(applyUserPrivacyOptions:(NSDictionary *) userPrivacyOptions pl
376
397
  }
377
398
  }
378
399
 
379
- - (DTXAction *) getAction:(nonnull NSNumber *)key
400
+ - (DTXAction *) getAction:(nonnull NSString *)key
380
401
  {
381
402
  return [actionDict objectForKey:key];
382
403
  }
@@ -6,57 +6,57 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_x86_64-simulator</string>
9
+ <string>ios-arm64</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>Dynatrace.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
- <string>x86_64</string>
16
15
  </array>
17
16
  <key>SupportedPlatform</key>
18
17
  <string>ios</string>
19
- <key>SupportedPlatformVariant</key>
20
- <string>simulator</string>
21
18
  </dict>
22
19
  <dict>
23
20
  <key>LibraryIdentifier</key>
24
- <string>tvos-arm64_x86_64-simulator</string>
21
+ <string>tvos-arm64</string>
25
22
  <key>LibraryPath</key>
26
23
  <string>Dynatrace.framework</string>
27
24
  <key>SupportedArchitectures</key>
28
25
  <array>
29
26
  <string>arm64</string>
30
- <string>x86_64</string>
31
27
  </array>
32
28
  <key>SupportedPlatform</key>
33
29
  <string>tvos</string>
34
- <key>SupportedPlatformVariant</key>
35
- <string>simulator</string>
36
30
  </dict>
37
31
  <dict>
38
32
  <key>LibraryIdentifier</key>
39
- <string>ios-arm64</string>
33
+ <string>ios-arm64_x86_64-simulator</string>
40
34
  <key>LibraryPath</key>
41
35
  <string>Dynatrace.framework</string>
42
36
  <key>SupportedArchitectures</key>
43
37
  <array>
44
38
  <string>arm64</string>
39
+ <string>x86_64</string>
45
40
  </array>
46
41
  <key>SupportedPlatform</key>
47
42
  <string>ios</string>
43
+ <key>SupportedPlatformVariant</key>
44
+ <string>simulator</string>
48
45
  </dict>
49
46
  <dict>
50
47
  <key>LibraryIdentifier</key>
51
- <string>tvos-arm64</string>
48
+ <string>tvos-arm64_x86_64-simulator</string>
52
49
  <key>LibraryPath</key>
53
50
  <string>Dynatrace.framework</string>
54
51
  <key>SupportedArchitectures</key>
55
52
  <array>
56
53
  <string>arm64</string>
54
+ <string>x86_64</string>
57
55
  </array>
58
56
  <key>SupportedPlatform</key>
59
57
  <string>tvos</string>
58
+ <key>SupportedPlatformVariant</key>
59
+ <string>simulator</string>
60
60
  </dict>
61
61
  </array>
62
62
  <key>CFBundlePackageType</key>