@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
@@ -1,5 +1,5 @@
1
1
  // Dynatrace.h
2
- // Version: 8.327.1.1020
2
+ // Version: 8.331.1.1008
3
3
  //
4
4
  // These materials contain confidential information and
5
5
  // trade secrets of Dynatrace Corporation. You shall
@@ -86,7 +86,7 @@ typedef NS_ENUM(int, DTX_StatusCode) {
86
86
  @discussion It can be used to modify an event scheduled to be sent.
87
87
  */
88
88
  @interface DTXModifyableEvent : NSObject
89
- @property (nonatomic, readwrite) NSMutableDictionary<NSString*,id> * _Nonnull attributes;
89
+ @property (nonatomic, readwrite) NSMutableDictionary<NSString*,id> * _Nonnull fields;
90
90
  @end
91
91
 
92
92
  /*!
@@ -455,12 +455,12 @@ typedef NS_ENUM(int, DTX_StatusCode) {
455
455
  /*!
456
456
  @brief Provides the ability to manually create web request events.
457
457
 
458
- The DTXHttpRequestEventBuilder class provides the ability to manually create web request events.
458
+ The DTXHttpRequestEventData class provides the ability to manually create web request events.
459
459
  */
460
- @interface DTXHttpRequestEventBuilder : NSObject
460
+ @interface DTXHttpRequestEventData : NSObject
461
461
 
462
462
  /*!
463
- @brief Intialises a http web request builder with the mandatory properties. Invalid properties on the builder will
463
+ @brief Intialises a http web request data object with the mandatory properties. Invalid properties will
464
464
  cause the event to be dropped.
465
465
 
466
466
  @param url The url including the scheme. Only http and https are supported.
@@ -470,64 +470,174 @@ typedef NS_ENUM(int, DTX_StatusCode) {
470
470
  - (instancetype _Nonnull)initWithURL:(NSString* _Nonnull)url method:(NSString* _Nonnull)method;
471
471
 
472
472
  /*!
473
- @brief Adds the duration of the web request to the builder. The duration is measured in milliseconds.
473
+ @brief Adds the duration of the web request. The duration is measured in milliseconds.
474
474
 
475
475
  @param duration The duration of the request in milliseconds.
476
476
  */
477
- - (DTXHttpRequestEventBuilder* _Nonnull)withDuration:(NSNumber* _Nonnull)duration;
477
+ - (DTXHttpRequestEventData* _Nonnull)withDuration:(NSNumber* _Nonnull)duration;
478
478
 
479
479
  /*!
480
- @brief Adds the status code to the builder. The status code has to be greater than or equal to 0.
480
+ @brief Adds the status code. The status code has to be greater than or equal to 0.
481
481
 
482
482
  @param statusCode The status code of the request.
483
483
  */
484
- - (DTXHttpRequestEventBuilder* _Nonnull)withStatusCode:(NSNumber* _Nonnull)statusCode;
484
+ - (DTXHttpRequestEventData* _Nonnull)withStatusCode:(NSNumber* _Nonnull)statusCode;
485
485
 
486
486
  /*!
487
- @brief Adds reason phrase to the builder.
487
+ @brief Adds reason phrase.
488
488
 
489
489
  @param reasonPhrase The reason phrase of the request.
490
490
  */
491
- - (DTXHttpRequestEventBuilder* _Nonnull)withReasonPhrase:(NSString* _Nonnull)reasonPhrase;
491
+ - (DTXHttpRequestEventData* _Nonnull)withReasonPhrase:(NSString* _Nonnull)reasonPhrase;
492
492
 
493
493
  /*!
494
494
  @brief Adds an error to the web request.
495
495
 
496
496
  @param error The error to be added to the request.
497
497
  */
498
- - (DTXHttpRequestEventBuilder* _Nonnull)withError:(NSError* _Nonnull)error;
498
+ - (DTXHttpRequestEventData* _Nonnull)withError:(NSError* _Nonnull)error;
499
499
 
500
500
  /*!
501
501
  @brief Adds the bytes sent to the web request. This value has to be bigger or equal to 0.
502
502
 
503
503
  @param bytesSent the number of bytes sent for the request.
504
504
  */
505
- - (DTXHttpRequestEventBuilder* _Nonnull)withBytesSent:(NSNumber* _Nonnull)bytesSent;
505
+ - (DTXHttpRequestEventData* _Nonnull)withBytesSent:(NSNumber* _Nonnull)bytesSent;
506
506
 
507
507
  /*!
508
508
  @brief Adds the bytes received to the web request. This value has to be bigger or equal to 0.
509
509
 
510
510
  @param bytesReceived the number of bytes received for the request.
511
511
  */
512
- - (DTXHttpRequestEventBuilder* _Nonnull)withBytesReceived:(NSNumber* _Nonnull)bytesReceived;
512
+ - (DTXHttpRequestEventData* _Nonnull)withBytesReceived:(NSNumber* _Nonnull)bytesReceived;
513
513
 
514
514
  /*!
515
- @brief Adds the given traceparent header to the builder. The traceparent header must follow the [specification](https://www.w3.org/TR/trace-context/#traceparent-header), otherwise it will be dropped.
515
+ @brief Adds the given traceparent header. The traceparent header must follow the [specification](https://www.w3.org/TR/trace-context/#traceparent-header), otherwise it will be dropped.
516
516
 
517
517
  @param traceparent the traceparent header.
518
518
  */
519
- - (DTXHttpRequestEventBuilder* _Nonnull)withTraceparentHeader:(NSString* _Nonnull)traceparent;
519
+ - (DTXHttpRequestEventData* _Nonnull)withTraceparentHeader:(NSString* _Nonnull)traceparent;
520
520
 
521
521
  /*!
522
- @brief Adds an event property with the given value to the builder. Note that event properties have to be prefixed with `event_properties.`, otherwise they will be dropped.
522
+ @brief Adds an event property with the given value. Note that event properties have to be prefixed with `event_properties.`, otherwise they will be dropped.
523
523
 
524
524
  @param property The name of the event property.
525
525
  @param value The response phrase of the request.
526
526
  */
527
- - (DTXHttpRequestEventBuilder* _Nonnull)addEventProperty:(NSString* _Nonnull)property value:(id _Nonnull)value;
527
+ - (DTXHttpRequestEventData* _Nonnull)addEventProperty:(NSString* _Nonnull)property value:(id _Nullable)value;
528
528
 
529
529
  @end
530
530
 
531
+ /*!
532
+ @brief Provides the ability to manually create custom events.
533
+
534
+ The DTXEventData class provides the ability to manually create custom events with optional duration and event properties.
535
+ */
536
+ @interface DTXEventData : NSObject
537
+
538
+ /*!
539
+ @brief Initialises a custom event data object.
540
+ */
541
+ - (instancetype _Nonnull)init;
542
+
543
+ /*!
544
+ @brief Adds the duration of the event. The duration is measured in milliseconds.
545
+
546
+ @param duration The duration of the event in milliseconds.
547
+ */
548
+ - (DTXEventData* _Nonnull)withDuration:(NSNumber* _Nonnull)duration;
549
+
550
+ /*!
551
+ @brief Adds an event property with the given value. Note that event properties have to be prefixed with `event_properties.`, otherwise they will be dropped.
552
+
553
+ @param property The name of the event property.
554
+ @param value The value of the event property.
555
+ */
556
+ - (DTXEventData* _Nonnull)addEventProperty:(NSString* _Nonnull)property value:(id _Nullable)value;
557
+
558
+ @end
559
+
560
+ /*!
561
+ @brief Provides the ability to manually create exception events.
562
+
563
+ The DTXExceptionEventData class provides the ability to manually create exception events with optional duration and event properties.
564
+ */
565
+ @interface DTXExceptionEventData : NSObject
566
+
567
+ /*!
568
+ @brief Initialises an exception event data object with the mandatory exception.
569
+
570
+ @param exception The exception that has been caught.
571
+ */
572
+ - (instancetype _Nonnull)initWithException:(NSException* _Nonnull)exception;
573
+
574
+ /*!
575
+ @brief Adds an event property with the given value. Note that event properties have to be prefixed with `event_properties.`, otherwise they will be dropped.
576
+
577
+ @param property The name of the event property.
578
+ @param value The value of the event property.
579
+ */
580
+ - (DTXExceptionEventData* _Nonnull)addEventProperty:(NSString* _Nonnull)property value:(id _Nullable)value;
581
+
582
+ @end
583
+
584
+ /*!
585
+ @brief Provides the ability to create session property events.
586
+
587
+ The DTXSessionPropertyEventData class provides the ability to create session property events that apply to all events in the current session.
588
+ */
589
+ @interface DTXSessionPropertyEventData : NSObject
590
+
591
+ /*!
592
+ @brief Initialises a session property event data object.
593
+ */
594
+ - (instancetype _Nonnull)init;
595
+
596
+ /*!
597
+ @brief Adds a session property with the given value. Note that session properties have to be prefixed with `session_properties.`, otherwise they will be dropped.
598
+
599
+ @param property The name of the session property.
600
+ @param value The value of the session property.
601
+ */
602
+ - (DTXSessionPropertyEventData* _Nonnull)addSessionProperty:(NSString* _Nonnull)property value:(id _Nullable)value;
603
+
604
+ @end
605
+ /*************************************************************************************************/
606
+
607
+ /*!
608
+ @brief Encapsulates contextual data for a single captured web request.
609
+ @property request The request associated with the web request event.
610
+ @property response The response returned by the server. Nil if no response was obtained.
611
+ @property responseBody Raw response body data (may be nil or truncated based on configuration).
612
+ @property error Transport or protocol error if the request failed. Nil on success.
613
+ */
614
+
615
+ @interface DTXHttpRequestEventContext : NSObject
616
+
617
+ @property (nonatomic, strong, readonly, nonnull) NSURLRequest *request;
618
+ @property (nonatomic, strong, readonly, nullable) NSURLResponse *response;
619
+ @property (nonatomic, strong, readonly, nullable) NSData *responseBody;
620
+ @property (nonatomic, strong, readonly, nullable) NSError *error;
621
+
622
+ /**
623
+ @brief Designated initializer.
624
+
625
+ @param request The NSURLRequest associated with the event.
626
+ @param response The NSURLResponse (if available) or nil.
627
+ @param responseBody The raw body payload (if available) or nil.
628
+ @param error The error encountered (nil for successful responses).
629
+ */
630
+ - (instancetype _Nonnull)initWithRequest:(NSURLRequest *_Nonnull)request
631
+ response:(NSURLResponse * _Nullable)response
632
+ responseBody:(NSData * _Nullable)responseBody
633
+ error:(NSError * _Nullable)error;
634
+
635
+ /// Unavailable. Use the designated initializer.
636
+ - (instancetype _Nonnull)init NS_UNAVAILABLE;
637
+
638
+ @end
639
+
640
+ /*************************************************************************************************/
531
641
 
532
642
  /*!
533
643
  @brief DTXUserPrivacyOptions protocol should be implemented by objects passed to applyUserPrivacyOptions:completion: method.
@@ -881,8 +991,7 @@ When the user optin feature is not used:
881
991
  With sendBizEvent, you can report a business event. These standalone events are being sent detached from user actions or sessions.
882
992
  The 'dt' key, as well as all 'dt.' prefixed keys are considered reserved by Dynatrace and will be stripped from the passed in attributes.
883
993
  Note: Business events are only supported on Dynatrace SaaS deployments currently.
884
- https://www.dynatrace.com/support/help/how-to-use-dynatrace/business-analytics/ba-events-capturing#get-business-events-from-rum
885
-
994
+ https://docs.dynatrace.com/docs/observe/business-observability/bo-events-capturing#report-business-event-rum
886
995
  @param type type of the event being sent
887
996
  @param attributes dictionary of attributes being attached to the sent event
888
997
  */
@@ -898,51 +1007,37 @@ When the user optin feature is not used:
898
1007
  + (void)shareLogsFileOnViewController:(UIViewController* _Nonnull)viewController;
899
1008
 
900
1009
  /*!
901
- * @brief Sends an event with the fields specified. A context can be added to provide information for later modification.
902
- *
903
- * The keys of the fields have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
904
- *
905
- * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
906
- *
907
- * @param fields fields of the event being sent
908
- * @param eventContext context of the event being sent provided for potential later modification
909
- */
910
- + (void)sendEventWithFields:(NSDictionary<NSString*,id>* _Nullable)fields eventContext:(id _Nullable)eventContext NS_SWIFT_NAME(sendEvent(fields:eventContext:));
911
-
912
- /*!
913
- * @brief Sends a web request event with the fields set in the builder. Use the builder to add data to the request event.
1010
+ * @brief Sends a RUM event with the fields set in the data object. Use the data object to add data to the event.
914
1011
  *
915
1012
  * The keys of the fields added via addEventProperty() have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
916
1013
  *
917
1014
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
918
1015
  *
919
- * @param builder the builder used to be create the event
1016
+ * @param data the data object used to create the event
920
1017
  */
921
- + (void)sendHttpRequestEvent:(DTXHttpRequestEventBuilder* _Nonnull)builder;
1018
+ + (void)sendEvent:(DTXEventData* _Nullable)data;
922
1019
 
923
1020
  /*!
924
- * @brief Sends an exception event with the fields specified.
1021
+ * @brief Sends a web request event with the fields set in the data object. Use the data object to add data to the request event.
925
1022
  *
926
- * The keys of the fields have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
1023
+ * The keys of the fields added via addEventProperty() have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
927
1024
  *
928
1025
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
929
1026
  *
930
- * @param exception the exception that has been thrown
931
- * @param fields custom fields of the event being sent
1027
+ * @param data the data object used to create the event
932
1028
  */
933
- + (void)sendExceptionEventWithException:(NSException* _Nonnull)exception fields:(NSDictionary<NSString*,id>* _Nullable)fields;
1029
+ + (void)sendHttpRequestEvent:(DTXHttpRequestEventData* _Nonnull)data;
934
1030
 
935
1031
  /*!
936
- * @brief Sends an exception event with the fields specified in the fieldsProvider.
1032
+ * @brief Sends an exception event with the fields set in the data object. Use the data object to add data to the exception event.
937
1033
  *
938
- * The keys provided in the fieldsProvider have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
1034
+ * The keys of the fields added via addEventProperty() have to be prefixed with `event_properties.` in order to be handled by the agent. All other fields will be dropped.
939
1035
  *
940
1036
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
941
1037
  *
942
- * @param exception the exception that has been thrown
943
- * @param fieldsProvider contains custom fields to be attached to the event
1038
+ * @param data the data object used to create the exception event
944
1039
  */
945
- + (void)sendExceptionEventWithException:(NSException* _Nonnull)exception provider:(void (^ _Nonnull)(NSMutableDictionary * _Nonnull fields))fieldsProvider;
1040
+ + (void)sendExceptionEvent:(DTXExceptionEventData* _Nonnull)data;
946
1041
 
947
1042
  /*!
948
1043
  * @brief A view refers to a view/screen/window which a user is presented with at any one time. On every opening of a view
@@ -957,23 +1052,25 @@ When the user optin feature is not used:
957
1052
  + (void)startViewWithName:(NSString* _Nonnull)name NS_SWIFT_NAME(startView(name:));
958
1053
 
959
1054
  /*!
960
- * @brief Method clears the previous view context, if set.
1055
+ * @brief Adds a modifier that enriches future events by applying the modifier function to them.
961
1056
  *
962
1057
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
963
1058
  *
964
- * See startViewWithName(NSString*)name
1059
+ * @param eventModifier the modification function that is applied to each event
1060
+ * @return An event subscriber that can be used to remove the subscription
965
1061
  */
966
- + (void)stopView;
1062
+ + (DTXModifyEventSubscriber* _Nonnull)addEventModifier:(DTXModifyableEvent* _Nullable (^ _Nonnull)(DTXModifyableEvent* _Nonnull event))eventModifier;
967
1063
 
968
1064
  /*!
969
- * @brief Adds a modifier that enriches future events by applying the modifier function to them.
1065
+ * @brief Adds a modifier that enriches future web request events by applying the modifier function to them.
1066
+ * The modifier function receives a context object containing `URLRequest`, `URLResponse`, `Data` and `NSError` if available for each web request.
970
1067
  *
971
1068
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
972
1069
  *
973
1070
  * @param eventModifier the modification function that is applied to each event
974
1071
  * @return An event subscriber that can be used to remove the subscription
975
1072
  */
976
- + (DTXModifyEventSubscriber* _Nonnull)addEventModifier:(DTXModifyableEvent* _Nullable (^ _Nonnull)(DTXModifyableEvent* _Nonnull event, id _Nullable eventContext))eventModifier;
1073
+ + (DTXModifyEventSubscriber* _Nonnull)addHttpEventModifier:(DTXModifyableEvent* _Nullable (^ _Nonnull)(DTXModifyableEvent* _Nonnull event, DTXHttpRequestEventContext* _Nullable eventContext))eventModifier;
977
1074
 
978
1075
  /*!
979
1076
  * @brief Removes a previously added event modifier.
@@ -985,14 +1082,25 @@ When the user optin feature is not used:
985
1082
  + (void)removeEventModifier:(DTXModifyEventSubscriber* _Nonnull)subscriber;
986
1083
 
987
1084
  /*!
988
- * @brief Sends a session properties event. Any custom properties must be added in the `session_properties.*` namespace,
1085
+ * @brief Sends a session properties event with the fields set in the data object. Use the data object to add session properties.
1086
+ *
1087
+ * Any custom properties added via addSessionProperty() must be added in the `session_properties.*` namespace,
989
1088
  * otherwise they will be dropped. Only one session properties event may be active for every session.
990
1089
  *
991
1090
  * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
992
1091
  *
993
- * @param properties properties that apply to all events in the current session
1092
+ * @param data the data object used to create the session properties event
1093
+ */
1094
+ + (void)sendSessionPropertyEvent:(DTXSessionPropertyEventData* _Nullable)data;
1095
+
1096
+ /*!
1097
+ * @brief Set the URLSession used by the agent for network requests.
1098
+ *
1099
+ * Note: This feature is currently only supported for Real User Monitoring powered by Grail on Dynatrace SaaS deployments.
1100
+ *
1101
+ * @param urlSession new URLSession to be used by the agent for network requests.
994
1102
  */
995
- + (void)sendSessionPropertyEvent:(NSDictionary<NSString*,id>* _Nullable)properties;
1103
+ + (void)setURLSession:(NSURLSession* _Nonnull)urlSession;
996
1104
 
997
1105
  @end
998
1106
  #endif
@@ -1230,7 +1338,7 @@ extern NSString *_Nonnull const kDTXDetectRageTaps;
1230
1338
  @const kDTXInstrumentFrameworks
1231
1339
  Flag to force the agent to also look for viewControllers inside the frameworks linked with the application
1232
1340
  */
1233
- extern NSString *_Nonnull const kDTXInstrumentFrameworks;
1341
+ extern NSString *_Nonnull const kDTXInstrumentFrameworks __deprecated_msg("Deprecated as of version 8.331 with no replacement, do not use this flag anymore, it will be ignored.");
1234
1342
  /*!
1235
1343
  @const kDTXUIActionNamePrivacy
1236
1344
  If set to true, a label or accessibility identifier of a view will be replaced by the view class name when reporting a touch event.
@@ -10,7 +10,7 @@
10
10
  </data>
11
11
  <key>Headers/Dynatrace.h</key>
12
12
  <data>
13
- roZod/D4Wn+SkSn1sxhL4/JmpnY=
13
+ jajRIjuHpmWFFnoTO9MywwUH2eQ=
14
14
  </data>
15
15
  <key>Headers/DynatraceSwiftUI.h</key>
16
16
  <data>
@@ -22,15 +22,15 @@
22
22
  </data>
23
23
  <key>Info.plist</key>
24
24
  <data>
25
- u5/PKqe25oljJiwXBuAvCvL1c20=
25
+ u65bUxoSRsetE6qm6p3Y4TBzrjw=
26
26
  </data>
27
27
  <key>Modules/Dynatrace.swiftmodule/Project/arm64-apple-tvos-simulator.swiftsourceinfo</key>
28
28
  <data>
29
- BEnXY59r9YAi2z6YKqSrvTvBpys=
29
+ oGHg1zHpatLmNH0hKjUSgvi6DJo=
30
30
  </data>
31
31
  <key>Modules/Dynatrace.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo</key>
32
32
  <data>
33
- MR2T+0lNtVJ3+WPB7zjppz9I8es=
33
+ 5Okn2qhtQ2XvXsNYRsI9e1BWj2I=
34
34
  </data>
35
35
  <key>Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.abi.json</key>
36
36
  <data>
@@ -50,7 +50,7 @@
50
50
  </data>
51
51
  <key>Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.swiftmodule</key>
52
52
  <data>
53
- r3WKjHHw6EbETHUP1aIDrn0Jp20=
53
+ oMMq4KM0QVIg1/+QWpsZ8GroSxc=
54
54
  </data>
55
55
  <key>Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.abi.json</key>
56
56
  <data>
@@ -70,7 +70,7 @@
70
70
  </data>
71
71
  <key>Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule</key>
72
72
  <data>
73
- LIr+wvgl76H43jatsoSpxPVMTXE=
73
+ Cf8t2TIZfQXpUwHBeZnVCoVIdTQ=
74
74
  </data>
75
75
  <key>Modules/module.modulemap</key>
76
76
  <data>
@@ -94,7 +94,7 @@
94
94
  <dict>
95
95
  <key>hash2</key>
96
96
  <data>
97
- uL6ffq++6nu0tyr5IA2YbFv3RdiPAuk4HRTkg7XYPZY=
97
+ J2Pbsy0U+a5fERuIeS8/2QfnGf1AgY4rswHMcCICVfc=
98
98
  </data>
99
99
  </dict>
100
100
  <key>Headers/DynatraceSwiftUI.h</key>
@@ -115,14 +115,14 @@
115
115
  <dict>
116
116
  <key>hash2</key>
117
117
  <data>
118
- gYUksyvTIc6AESelG4V1suHyHEJmAF3gkSxqitFrkqo=
118
+ TTTPk5VFSNFN4dAhhUuHlVgV+abge+rNRW4ISyW3Kuo=
119
119
  </data>
120
120
  </dict>
121
121
  <key>Modules/Dynatrace.swiftmodule/Project/x86_64-apple-tvos-simulator.swiftsourceinfo</key>
122
122
  <dict>
123
123
  <key>hash2</key>
124
124
  <data>
125
- mTwRHNic5yCFZPoCTOWt1cRCtHOq8RX0OxCW+MhjCEw=
125
+ Wznf9xXzEQSLDDsseX+1LHdfTMJex4xT1XnvzLXbBS8=
126
126
  </data>
127
127
  </dict>
128
128
  <key>Modules/Dynatrace.swiftmodule/arm64-apple-tvos-simulator.abi.json</key>
@@ -157,7 +157,7 @@
157
157
  <dict>
158
158
  <key>hash2</key>
159
159
  <data>
160
- BVEdQi6Sx6d11PEaI6uFiz1nDoifWnx2JoDtkXfSnKg=
160
+ 0+QjK+9/wqDwCWscrUMZ+OYYHnniXKlLUafMDpugrZo=
161
161
  </data>
162
162
  </dict>
163
163
  <key>Modules/Dynatrace.swiftmodule/x86_64-apple-tvos-simulator.abi.json</key>
@@ -192,7 +192,7 @@
192
192
  <dict>
193
193
  <key>hash2</key>
194
194
  <data>
195
- 3OPxOnNeZshX1Uug2YtFiciQzIULmbfZn9SJOFRK+oI=
195
+ KXRSVDdV3mb3CZiOTU0x3C/AZ6xuPZ23sWLHTgdYcRU=
196
196
  </data>
197
197
  </dict>
198
198
  <key>Modules/module.modulemap</key>
@@ -1,3 +1,3 @@
1
1
  dependencies {
2
- classpath 'com.dynatrace.tools.android:gradle-plugin:8.327.2.1004'
2
+ classpath 'com.dynatrace.tools.android:gradle-plugin:8.331.1.1004'
3
3
  }
@@ -2,11 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeNetworkInterceptorUtils = void 0;
4
4
  var sessionStoragePrefix = '_dt.';
5
+ var parseDtAdkFromUserAgent = function (userAgent) {
6
+ var match = userAgent.match(/dtAdk=([^;\s)]+)/);
7
+ return match ? match[1] : '';
8
+ };
5
9
  var getDTC = function (actionId) {
6
10
  var referer = getReferer(actionId);
7
11
  var dtAdk = getCookieValue('dtAdk', false);
12
+ var userAgent = navigator.userAgent || '';
8
13
  if (dtAdk === '') {
9
- dtAdk = getLocalStorageValue('dtAdk');
14
+ if (userAgent.indexOf("dtAdk=") >= 0) {
15
+ dtAdk = parseDtAdkFromUserAgent(userAgent);
16
+ }
17
+ else {
18
+ dtAdk = getLocalStorageValue('dtAdk');
19
+ }
10
20
  }
11
21
  return "sn=\"".concat(getSessionNumber(getCookieValue('dtCookie', true)), "\", pc=\"").concat(patchPageContext(getCookieValue('dtPC', true), actionId), "\"")
12
22
  + ", v=\"".concat(getCookieValue('rxVisitor', true), "\", r=\"").concat(referer, "\", app=\"").concat(getApplicationId(), "\", adk=\"").concat(dtAdk, "\"");
@@ -5,6 +5,15 @@ var pluginId = module.id.slice(0, module.id.lastIndexOf('.'));
5
5
  var MobileFirstRequestInterceptor = require(pluginId + '.mobile-first-network-interceptor').MobileFirstRequestInterceptor;
6
6
  var NativeNetworkInterceptorUtils = require(pluginId + '.native-network-interceptor-utils').NativeNetworkInterceptorUtils;
7
7
  var exec = require('cordova/exec');
8
+ var postToMobileAgent = function (message) {
9
+ var _a, _b;
10
+ var handler = (_b = (_a = window.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.MobileAgent;
11
+ if (!handler || typeof handler.postMessage !== "function") {
12
+ console.warn("MobileAgent messageHandler isn't available!");
13
+ return;
14
+ }
15
+ handler.postMessage(message);
16
+ };
8
17
  module.exports = {
9
18
  endVisit: function (success, error) {
10
19
  success = success !== null && success !== void 0 ? success : emptyFunction;
@@ -16,14 +25,24 @@ module.exports = {
16
25
  getUserPrivacyOptions: function (success, error) {
17
26
  success = success !== null && success !== void 0 ? success : emptyFunction;
18
27
  error = error !== null && error !== void 0 ? error : emptyFunction;
19
- exec(success, error, 'DynatraceCordovaPlugin', 'getUserPrivacyOptions', []);
28
+ if (window.MobileAgent !== undefined) {
29
+ exec(success, error, 'DynatraceCordovaPlugin', 'getUserPrivacyOptions', []);
30
+ }
31
+ else if (window.cordova.platformId === "ios") {
32
+ postToMobileAgent({ "api": "getUserPrivacyOptions" });
33
+ }
20
34
  },
21
35
  applyUserPrivacyOptions: function (dataCollectionLevel, crashReportingOptedIn, success, error) {
22
36
  if (crashReportingOptedIn !== undefined && dataCollectionLevel !== undefined) {
23
- success = success !== null && success !== void 0 ? success : emptyFunction;
24
- error = error !== null && error !== void 0 ? error : emptyFunction;
25
- var options = { dataCollectionLevel: dataCollectionLevel, crashReportingOptedIn: crashReportingOptedIn };
26
- exec(success, error, 'DynatraceCordovaPlugin', 'applyUserPrivacyOptions', [options]);
37
+ if (window.MobileAgent !== undefined) {
38
+ success = success !== null && success !== void 0 ? success : emptyFunction;
39
+ error = error !== null && error !== void 0 ? error : emptyFunction;
40
+ var options = { dataCollectionLevel: dataCollectionLevel, crashReportingOptedIn: crashReportingOptedIn };
41
+ exec(success, error, 'DynatraceCordovaPlugin', 'applyUserPrivacyOptions', [options]);
42
+ }
43
+ else if (window.cordova.platformId === "ios") {
44
+ postToMobileAgent({ "api": "applyUserPrivacyOptions", "arguments": { "dataCollectionLevel": dataCollectionLevel, "crashReportingOptedIn": crashReportingOptedIn } });
45
+ }
27
46
  }
28
47
  else if (error !== undefined) {
29
48
  error('UserPrivacyOptions missing properties.');
@@ -21,7 +21,6 @@
21
21
  [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
22
22
  }
23
23
 
24
-
25
24
  - (void) getUserPrivacyOptions:(CDVInvokedUrlCommand*)command
26
25
  {
27
26
  NSMutableDictionary *privacyDict = [[NSMutableDictionary alloc] init];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/cordova-plugin",
3
- "version": "2.327.1",
3
+ "version": "2.331.1",
4
4
  "description": "This plugin gives you the ability to use the Dynatrace instrumentation in your hybrid application (Cordova, Ionic, ..). It uses the Mobile Agent, the JavaScript Agent. The Mobile Agent will give you all device specific values containing lifecycle information and the Javascript Agent will allow you to manually instrument your JavaScript/TypeScript code out of the box (Typescript definitions included). The JavaScript Agent will cover the network calls and will automatically detect them.",
5
5
  "cordova": {
6
6
  "id": "@dynatrace/cordova-plugin",
@@ -40,23 +40,24 @@
40
40
  "homepage": "https://www.dynatrace.com/",
41
41
  "license": "SEE LICENSE IN LICENSE.md",
42
42
  "dependencies": {
43
- "axios": "^1.13.2",
43
+ "axios": "^1.13.5",
44
44
  "jsdom": "^27.0.0",
45
45
  "plist": "^3.1.0"
46
46
  },
47
47
  "devDependencies": {
48
+ "@stylistic/eslint-plugin": "^5.7.1",
48
49
  "@types/jest": "^29.2.0",
49
50
  "@types/jsdom": "^21.1.7",
50
51
  "@types/mock-fs": "^4.13.1",
51
52
  "@types/node": "^18.19.71",
52
53
  "@types/plist": "^3.0.2",
53
54
  "@types/shelljs": "^0.8.9",
54
- "@typescript-eslint/eslint-plugin": "^5.16.0",
55
- "@typescript-eslint/parser": "^5.16.0",
56
- "eslint": "^8.11.0",
55
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
56
+ "@typescript-eslint/parser": "^8.54.0",
57
+ "eslint": "^9.39.2",
57
58
  "eslint-config-prettier": "^8.5.0",
58
59
  "eslint-plugin-import": "^2.25.4",
59
- "eslint-plugin-jsdoc": "^43.2.0",
60
+ "eslint-plugin-jsdoc": "^62.5.0",
60
61
  "eslint-plugin-prefer-arrow": "^1.2.3",
61
62
  "eslint-plugin-unicorn": "^41.0.1",
62
63
  "husky": "^9.1.7",
@@ -68,7 +69,8 @@
68
69
  "shelljs": "^0.8.4",
69
70
  "ts-jest": "^29.0.3",
70
71
  "ts-node": "^10.2.1",
71
- "typescript": "^4.8.4"
72
+ "typescript": "^4.8.4",
73
+ "typescript-eslint": "^8.54.0"
72
74
  },
73
75
  "files": [
74
76
  "assets/*",
@@ -81,7 +83,10 @@
81
83
  "scripts/*",
82
84
  "model/*",
83
85
  "typings/main.d.ts",
84
- "package.json"
86
+ "package.json",
87
+ "ios/*",
88
+ "Package.swift",
89
+ "Package.resolved"
85
90
  ],
86
91
  "jest-junit": {
87
92
  "suiteName": "jest tests",
package/plugin.xml CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  id="@dynatrace/cordova-plugin"
5
- version="2.327.1">
5
+ version="2.331.1">
6
6
  <name>Dynatrace</name>
7
7
  <description>Dynatrace Cordova Plugin</description>
8
8
 
@@ -41,7 +41,7 @@
41
41
  <source-file src="other/DynatraceCordovaPlugin.m"/>
42
42
  </platform>
43
43
  <platform name="android">
44
- <framework src="com.dynatrace.agent:agent-android:8.327.2.1004" />
44
+ <framework src="com.dynatrace.agent:agent-android:8.331.1.1004" />
45
45
  <source-file src="other/DynatraceCordovaPlugin.java" target-dir="src/com/dynatrace/cordova/plugin" />
46
46
 
47
47
  <config-file target="config.xml" parent="/*">
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var InstallHelper_1 = require("./helpers/InstallHelper");
3
4
  var InstrumentHelper_1 = require("./helpers/InstrumentHelper");
4
5
  module.exports = (function (context) { return new Promise(function (resolve) {
5
6
  (0, InstrumentHelper_1.instrument)(process).then(function () {
6
- resolve('');
7
+ (0, InstallHelper_1.replacePackageSwiftWithOriginal)().then(function () {
8
+ (0, InstallHelper_1.moveIosFilesForSPM)().then(function () {
9
+ resolve('');
10
+ });
11
+ });
7
12
  });
8
13
  }); })();