@dynatrace/cordova-plugin 2.327.1 → 2.331.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 (45) hide show
  1. package/Package.swift +32 -0
  2. package/README.md +91 -4
  3. package/files/iOS/Dynatrace.xcframework/Info.plist +9 -9
  4. package/files/iOS/Dynatrace.xcframework/_CodeSignature/CodeDirectory +0 -0
  5. package/files/iOS/Dynatrace.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  6. package/files/iOS/Dynatrace.xcframework/_CodeSignature/CodeResources +87 -87
  7. package/files/iOS/Dynatrace.xcframework/_CodeSignature/CodeSignature +0 -0
  8. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Dynatrace +0 -0
  9. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Headers/Dynatrace.h +162 -54
  10. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Info.plist +0 -0
  11. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  12. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.abi.json +19 -5
  13. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -1
  14. package/files/iOS/Dynatrace.xcframework/ios-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios.swiftinterface +1 -1
  15. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  16. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +162 -54
  17. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  18. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  19. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  20. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.abi.json +19 -5
  21. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -1
  22. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  23. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.abi.json +19 -5
  24. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -1
  25. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -1
  26. package/files/iOS/Dynatrace.xcframework/ios-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +23 -23
  27. package/files/iOS/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Dynatrace +0 -0
  28. package/files/iOS/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Dynatrace.h +162 -54
  29. package/files/iOS/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Info.plist +0 -0
  30. package/files/iOS/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-tvos.swiftsourceinfo +0 -0
  31. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  32. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +162 -54
  33. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  34. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo +0 -0
  35. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/Dynatrace.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo +0 -0
  36. package/files/iOS/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +11 -11
  37. package/files/plugin.gradle +1 -1
  38. package/networking/NativeNetworkInterceptorUtils.js +11 -1
  39. package/other/DynatraceCordovaPlugin.js +24 -5
  40. package/other/DynatraceCordovaPlugin.m +0 -1
  41. package/package.json +13 -8
  42. package/plugin.xml +2 -2
  43. package/scripts/InstrumentCap.js +6 -1
  44. package/scripts/helpers/InstallHelper.js +67 -1
  45. package/scripts/helpers/PathHelper.js +16 -1
package/Package.swift ADDED
@@ -0,0 +1,32 @@
1
+ // swift-tools-version: 5.9
2
+
3
+ import PackageDescription
4
+
5
+ let package = Package(
6
+ name: "DynatraceCordovaPlugin",
7
+ platforms: [.iOS(.v15)],
8
+ products: [
9
+ .library(
10
+ name: "DynatraceCordovaPlugin",
11
+ targets: ["DynatraceCordovaPlugin"]
12
+ )
13
+ ],
14
+ dependencies: [
15
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.1")
16
+ ],
17
+ targets: [
18
+ .target(
19
+ name: "DynatraceCordovaPlugin",
20
+ dependencies: [
21
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
22
+ "Dynatrace"
23
+ ],
24
+ path: "ios",
25
+ publicHeadersPath: "."
26
+ ),
27
+ .binaryTarget(
28
+ name: "Dynatrace",
29
+ path: "files/iOS/Dynatrace.xcframework"
30
+ )
31
+ ]
32
+ )
package/README.md CHANGED
@@ -22,6 +22,7 @@ For information as to why this is necessary, read more [here](#migration-from-ma
22
22
  * Gradle version 7.x+ ([How to update?](#updating-to-gradle-7))
23
23
  * Android Gradle Plugin version 7.0+
24
24
  * Java 11
25
+ * Jetpack Compose 1.4 - 1.10 - see [Compose Compatibility Note](#compose-compatibility-note)
25
26
  * For iOS users: Minimum iOS 12
26
27
  * For JavaScript Agent: access to API of cluster
27
28
  * Node: >= 20.x
@@ -31,8 +32,8 @@ For information as to why this is necessary, read more [here](#migration-from-ma
31
32
 
32
33
  These agent versions are configured in this plugin:
33
34
 
34
- * Android Agent: 8.327.2.1004
35
- * iOS Agent: 8.327.1.1020
35
+ * Android Agent: 8.331.1.1004
36
+ * iOS Agent: 8.331.1.1008
36
37
 
37
38
  ## Quick Setup
38
39
 
@@ -55,6 +56,7 @@ These agent versions are configured in this plugin:
55
56
  * [Plist Path](#plist-path)
56
57
  * [Mobile Agent configuration](#mobile-agent-configuration)
57
58
  * [Hybrid related configuration](#hybrid-related-configuration)
59
+ * [iOS only configuration](#ios-only-configuration)
58
60
  * [JavaScript Agent configuration](#javascript-agent-configuration)
59
61
  * [JavaScript Agent Snippet Mode](#javascript-agent-snippet-mode)
60
62
  * [HTML Instrumentation Requirements](#html-instrumentation-requirements)
@@ -80,6 +82,7 @@ These agent versions are configured in this plugin:
80
82
  * [Native OneAgent debug logs](#native-oneagent-debug-logs)
81
83
  * [Android](#android)
82
84
  * [iOS](#ios)
85
+ * [Compose Compatibility Note](#compose-compatibility-note)
83
86
  * [Official documentation](#official-documentation)
84
87
  * [Doctor Dynatrace](#doctor-dynatrace)
85
88
  * [Instrumentation Overhead](#instrumentation-overhead)
@@ -139,6 +142,8 @@ This screen shows what a `combined` sample user session should roughly look like
139
142
 
140
143
  To instrument your Ionic Capacitor app, you will need to follow the steps below:
141
144
 
145
+ **Note for Capacitor iOS:** Starting with Capacitor 8, new iOS projects by default use Swift Package Manager (SPM) instead of CocoaPods. The Dynatrace Cordova Plugin supports SPM based Cordova/Ionic + Capacitor projects. The steps are the same for both CocoaPods and SPM to setup/install the plugin.
146
+
142
147
  1. Install the Dynatrace Cordova Plugin via the following command:
143
148
  * `npm install @dynatrace/cordova-plugin`
144
149
  ** **Note:** If you do not want our plugin to modify your `package.json`, you can choose to opt-out of that process. See [opt-out](#opt-out) for more details.
@@ -218,7 +223,7 @@ There is flag for updating the CSP (Content Security Policy). By default this va
218
223
 
219
224
  ### Cookie Proxy
220
225
 
221
- Issues with cookies are somehow a persistent companion in Ionic or Capacitor applications. Therefore we provide a proxy script which is wrapping the document.cookie API and are storing the cookies which are important for the Dynatrace Agents in the session storage. Of course this wrapping is still calling the original API. Please see the [Capacitor Cookie Proxy](#capacitor-cookie-proxy) section below if you are using `CapacitorCookies` in your application. If not, please see the configuration below.
226
+ Issues with cookies are somehow a persistent companion in Ionic or Capacitor applications. Therefore, we provide a proxy script which is wrapping the document.cookie API and are storing the cookies which are important for the Dynatrace Agents in the session storage. Of course this wrapping is still calling the original API. Please see the [Capacitor Cookie Proxy](#capacitor-cookie-proxy) section below if you are using `CapacitorCookies` in your application. If not, please see the configuration below.
222
227
 
223
228
  Per default the cookie proxy is turned off. To make use of this proxy you need to enable it in the cordova configuration in the dynatrace.config.js:
224
229
 
@@ -324,6 +329,40 @@ module.exports = {
324
329
 
325
330
  * `DTXSetCookiesForDomain` or `hybridWebView.domains` : For hybrid applications using the JavaScript agent, cookies need to be set for each instrumented domain or server the application communicates with. You can specify domains, host or IP addresses. Domains or sub-domains must start with a dot. Separate the list elements with a comma.
326
331
 
332
+ ### iOS only configuration
333
+
334
+ The `DTXHybridApplicationMode` flag is available for iOS only.
335
+
336
+ Using the default value of `cookies` will set the behavior of the iOS agent to inject Javascript into the webview which allows the JS agent and iOS agent to correlate the mobile and web session via cookies and or local storage.
337
+
338
+ ```js
339
+ module.exports = {
340
+ ios : {
341
+ config : `
342
+ <key>DTXHybridApplicationMode</key>
343
+ <string>cookies</string>
344
+ `
345
+ }
346
+ }
347
+ ```
348
+
349
+ Using the value of `useragent` will result in modifying the UserAgent header, which appends specific key/values that will allow the JS agent to correlate mobile and web sessions properly. This option requires cluster version (or JavaScript Agent version) 327 or higher.
350
+
351
+ **Note:** Using this setting will preserve the original UserAgent header and append the following string: `DTHybrid/x.x dtAdk=... dtAdkSettings=...`
352
+
353
+ ```js
354
+ module.exports = {
355
+ ios : {
356
+ config : `
357
+ <key>DTXHybridApplicationMode</key>
358
+ <string>useragent</string>
359
+ `
360
+ }
361
+ }
362
+ ```
363
+
364
+ * `DTXHybridApplication` or `hybridWebView.enabled` : Set to `true` if you have a Hybrid application. This property is automatically set to true if you are using the dynatrace.config.js file downloaded from the Instrumentation Wizard. Otherwise, the default value is `false`.
365
+
327
366
  ## JavaScript Agent configuration
328
367
 
329
368
  Basically all needed properties for the JavaScript Agent are predefined by the downloadable `dynatrace.config.js`. There are four available properties:
@@ -844,6 +883,41 @@ ios: {
844
883
  }
845
884
  ```
846
885
 
886
+ ## Compose Compatibility Note
887
+
888
+ Our Android Agent currently supports **Jetpack Compose 1.4 - 1.10**. If you are using an incompatible version of Jetpack Compose, you may encounter the following error message during build:
889
+
890
+ ```
891
+ Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
892
+ Version '1.0.0' of artifact 'androidx.compose.material:material' is not supported.
893
+ Please use the latest version of the Dynatrace Android Gradle plugin.
894
+ ```
895
+
896
+ If you encounter compatibility issues or want to disable Jetpack Compose instrumentation, you can configure this in your `dynatrace.config.js` file. **Note: Disabling Jetpack Compose instrumentation will skip the compatibility check, allowing you to build with any version of Jetpack Compose without triggering version validation errors.**
897
+
898
+ **Important**: The configuration example below shows **only the Compose-specific setting**. You must ensure that your complete `dynatrace.config.js` file includes all other required configuration settings (such as `beaconUrl`, `applicationId`, etc.) as described in the [Android block](#mobile-agent-configuration) section of this documentation.
899
+
900
+ ```js
901
+ module.exports = {
902
+ // ...
903
+ android: {
904
+ config: `
905
+ dynatrace {
906
+ configurations {
907
+ defaultConfig {
908
+ userActions {
909
+ composeEnabled false
910
+ }
911
+ }
912
+ }
913
+ }
914
+ `,
915
+ }
916
+ };
917
+ ```
918
+
919
+ For more information about Jetpack Compose instrumentation and monitoring capabilities, please refer to the [official Dynatrace documentation for Android OneAgent](https://docs.dynatrace.com/docs/observe/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-plugin/monitoring-capabilities#compose-enable).
920
+
847
921
  ## Official documentation
848
922
 
849
923
  * Android Agent: https://www.dynatrace.com/support/help/technology-support/operating-systems/android/
@@ -884,6 +958,8 @@ Basically if you have problems with the plugin please have a look into the logs.
884
958
  * If you have problems retrieving the JavaScript Agent and you get error messages that the JavaScript Agent can not be retrieved, you probably don't have access to the API or there is a certificate issue. If this is the certificate use the [allow any certificate](#allow-any-certificate) feature. In any other case a workaround is possible to use the cli and add the `--jsagent=` custom parameter and download the full Javascript Agent and add the path to the downloaded JS Agent file to the custom parameter value - With this the plugin will not retrieve the JS agent and will use the one that is specified.
885
959
  * If you are not seeing data when using Capacitor 3+, please make sure you follow the steps in the [Capacitor Instrumentation](#capacitor-instrumentation) section (more specifically step 4 for the proper commands). Please read the note at the bottom of that section for more information.
886
960
  * For Android, if you see an error like "Gradle sync failed: Could not find com.dynatrace.tools.android:gradle-plugin:8.221.1.1005.", please see the [MavenCentral](#mavencentral-in-top-level-gradle-file) section for an example and more information.
961
+ * If you see a message like "Error: Could not retrieve JS Agent optionsForbidden", this means that the internal axios library is too old for processing the request correctly. The solution is to update the Cordova Plugin version, which internally uses a newer axios version to retrieve the JavaScript agent.
962
+
887
963
 
888
964
  ### iOS Session Correlation Issues
889
965
 
@@ -900,10 +976,21 @@ To resolve this issue and allow the Mobile and Web sessions to correlate properl
900
976
 
901
977
  When using Apple Pay with WKWebView, there are specific checks that WebKit (Apple) uses when loading the Apple Pay SDK. The Apple Pay SDK does not work when using script injection APIs which is what our iOS agent uses to properly communicate with the JS agent and to correlate the Mobile and Web User Sessions.
902
978
 
903
- **Workaround:** You can set the `DTXHybridApplication` flag to false which will remove the injection of our script. This will also remove the correlation of the Mobile and Web Sessions.
979
+ **Solution:** Set the `DTXHybridApplicationMode` flag to `useragent` that will allow our plugin to work properly with Apple Pay. For more information, see [iOS only configuration.](#ios-only-configuration)
980
+
981
+ **Other Workaround:** You can set the `DTXHybridApplication` flag to false which will remove the injection of our script. This will also remove the correlation of the Mobile and Web Sessions.
904
982
 
905
983
  ## Changelog
906
984
 
985
+ 2.331.1
986
+ * Updated Android (8.331.1.1004) & iOS Agent (8.331.1.1008)
987
+ * Added Swift Package Manager (SPM) support for Capacitor iOS projects
988
+ * Added [Compose Compatibility Note](#compose-compatibility-note)
989
+
990
+ 2.329.1
991
+ * Updated Android (8.329.1.1014) & iOS Agent (8.329.1.1017)
992
+ * Updated logic for dynatraceMobile API for iOS to use messageHandler if there is no script injection in WKWebView (see [iOS only configuration](#ios-only-configuration))
993
+
907
994
  2.327.1
908
995
  * Updated Android (8.327.2.1004) & iOS Agent (8.327.1.1020)
909
996
 
@@ -8,7 +8,7 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>Dynatrace.framework/Dynatrace</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>tvos-arm64</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>Dynatrace.framework</string>
14
14
  <key>SupportedArchitectures</key>
@@ -16,30 +16,27 @@
16
16
  <string>arm64</string>
17
17
  </array>
18
18
  <key>SupportedPlatform</key>
19
- <string>tvos</string>
19
+ <string>ios</string>
20
20
  </dict>
21
21
  <dict>
22
22
  <key>BinaryPath</key>
23
23
  <string>Dynatrace.framework/Dynatrace</string>
24
24
  <key>LibraryIdentifier</key>
25
- <string>tvos-arm64_x86_64-simulator</string>
25
+ <string>tvos-arm64</string>
26
26
  <key>LibraryPath</key>
27
27
  <string>Dynatrace.framework</string>
28
28
  <key>SupportedArchitectures</key>
29
29
  <array>
30
30
  <string>arm64</string>
31
- <string>x86_64</string>
32
31
  </array>
33
32
  <key>SupportedPlatform</key>
34
33
  <string>tvos</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
34
  </dict>
38
35
  <dict>
39
36
  <key>BinaryPath</key>
40
37
  <string>Dynatrace.framework/Dynatrace</string>
41
38
  <key>LibraryIdentifier</key>
42
- <string>ios-arm64_x86_64-simulator</string>
39
+ <string>tvos-arm64_x86_64-simulator</string>
43
40
  <key>LibraryPath</key>
44
41
  <string>Dynatrace.framework</string>
45
42
  <key>SupportedArchitectures</key>
@@ -48,7 +45,7 @@
48
45
  <string>x86_64</string>
49
46
  </array>
50
47
  <key>SupportedPlatform</key>
51
- <string>ios</string>
48
+ <string>tvos</string>
52
49
  <key>SupportedPlatformVariant</key>
53
50
  <string>simulator</string>
54
51
  </dict>
@@ -56,15 +53,18 @@
56
53
  <key>BinaryPath</key>
57
54
  <string>Dynatrace.framework/Dynatrace</string>
58
55
  <key>LibraryIdentifier</key>
59
- <string>ios-arm64</string>
56
+ <string>ios-arm64_x86_64-simulator</string>
60
57
  <key>LibraryPath</key>
61
58
  <string>Dynatrace.framework</string>
62
59
  <key>SupportedArchitectures</key>
63
60
  <array>
64
61
  <string>arm64</string>
62
+ <string>x86_64</string>
65
63
  </array>
66
64
  <key>SupportedPlatform</key>
67
65
  <string>ios</string>
66
+ <key>SupportedPlatformVariant</key>
67
+ <string>simulator</string>
68
68
  </dict>
69
69
  </array>
70
70
  <key>CFBundlePackageType</key>