@dynatrace/react-native-plugin 2.307.1 → 2.311.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.
- package/README.md +13 -4
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceAppStartModule.kt +128 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceInternalModule.kt +22 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +411 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +54 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +86 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurement.kt +15 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurementType.kt +18 -0
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +228 -0
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +258 -0
- package/files/plugin.gradle +1 -1
- package/index.js +10 -10
- package/instrumentation/DynatraceInstrumentation.js +1 -0
- package/{lib → instrumentation/jsx}/CreateElement.js +6 -5
- package/{lib/instrumentor/base → instrumentation/jsx}/ElementHelper.js +14 -12
- package/instrumentation/jsx/JsxDevRuntime.js +54 -0
- package/instrumentation/jsx/JsxRuntime.js +57 -0
- package/instrumentation/jsx/JsxRuntimeUtil.js +31 -0
- package/instrumentation/jsx/components/ClassComponent.js +49 -0
- package/instrumentation/jsx/components/ComponentUtil.js +33 -0
- package/instrumentation/jsx/components/FunctionalComponent.js +15 -0
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Picker.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/RefreshControl.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Switch.js +8 -8
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Touchable.js +8 -8
- package/instrumentation/libs/community/Picker.InstrInfo.js +20 -0
- package/{lib → instrumentation/libs}/community/Picker.js +1 -1
- package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +23 -0
- package/{lib → instrumentation/libs}/community/gesture-handler/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-native/RefreshControl.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/RefreshControl.js +5 -5
- package/{lib → instrumentation/libs}/react-native/Switch.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/Switch.js +5 -5
- package/instrumentation/libs/react-native/Touchables.InstrInfo.js +25 -0
- package/{lib → instrumentation/libs}/react-native/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-navigation/ReactNavigation.js +6 -5
- package/{lib/instrumentor → instrumentation}/model/Types.js +1 -14
- package/instrumentation/model/TypesUtil.js +50 -0
- package/ios/DynatraceRNBridge.h +10 -1
- package/ios/DynatraceRNBridge.mm +152 -1
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/lib/core/Application.js +20 -0
- package/lib/{instrumentor/base → core}/Dynatrace.js +72 -48
- package/lib/{instrumentor/base → core}/DynatraceAction.js +23 -22
- package/lib/core/DynatraceInternal.js +46 -0
- package/lib/{instrumentor/base → core}/DynatraceRootAction.js +5 -4
- package/lib/{instrumentor/base → core}/DynatraceWebRequestTiming.js +6 -5
- package/lib/{instrumentor/base → core}/ErrorHandler.js +6 -5
- package/lib/{instrumentor/base → core}/configuration/Configuration.js +1 -1
- package/lib/{instrumentor/base → core}/configuration/ConfigurationDefaults.js +1 -2
- package/lib/{instrumentor/base → core}/configuration/ConfigurationHandler.js +2 -2
- package/lib/{instrumentor/base → core}/configuration/ManualStartupConfiguration.js +1 -1
- package/lib/core/logging/ConsoleLogger.js +27 -0
- package/lib/core/logging/LogLevel.js +12 -0
- package/lib/dynatrace-transformer.js +1 -1
- package/lib/next/Dynatrace.js +88 -0
- package/lib/next/DynatraceSecondGenForwarder.js +35 -0
- package/lib/next/IDynatrace.js +2 -0
- package/lib/next/IDynatraceForwarder.js +2 -0
- package/lib/next/appstart/AppStartObserver.js +34 -0
- package/lib/next/appstart/AppStartType.js +38 -0
- package/lib/next/events/EventCreator.js +77 -0
- package/lib/next/events/EventPipeline.js +58 -0
- package/lib/next/events/EventTimestamp.js +27 -0
- package/lib/next/events/ViewInfoCreator.js +27 -0
- package/lib/next/events/modifier/BaseDataEventModifier.js +31 -0
- package/lib/next/events/modifier/EventLimitation.js +69 -0
- package/lib/next/events/modifier/EventModifierUtil.js +89 -0
- package/lib/next/events/modifier/IEventModifier.js +2 -0
- package/lib/next/events/modifier/ModifyEventValidation.js +189 -0
- package/lib/next/events/modifier/SendEventValidation.js +86 -0
- package/lib/next/events/modifier/ValueRestrictionModifier.js +56 -0
- package/lib/next/events/spec/EventFieldKeysEnum.js +2 -0
- package/lib/next/events/spec/EventSpecContstants.js +47 -0
- package/lib/next/events/spec/IAppStartEvent.js +2 -0
- package/lib/next/events/spec/ICrashEvent.js +2 -0
- package/lib/next/events/spec/IErrorCodeEvent.js +2 -0
- package/lib/next/events/spec/IErrorExceptionEvent.js +2 -0
- package/lib/next/events/spec/IReactNativeEvent.js +2 -0
- package/lib/next/events/spec/IRumEvent.js +2 -0
- package/lib/next/provider/ITimestampProvider.js +2 -0
- package/lib/next/provider/TimestampProvider.js +10 -0
- package/package.json +42 -33
- package/react-native-dynatrace.podspec +1 -1
- package/scripts/Android.js +10 -4
- package/scripts/PathsConstants.js +3 -1
- package/scripts/core/InstrumentCall.js +1 -0
- package/src/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.ts +8 -0
- package/typings/react-native-dynatrace.d.ts +73 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.java +0 -366
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.java +0 -67
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.java +0 -108
- package/android/src/main/java/com/dynatrace/android/agent/PrivateDTBridge.java +0 -28
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -192
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -194
- package/lib/community/Picker.InstrInfo.js +0 -20
- package/lib/community/gesture-handler/Touchables.InstrInfo.js +0 -56
- package/lib/instrumentor/DynatraceInstrumentation.js +0 -1
- package/lib/instrumentor/base/Application.js +0 -16
- package/lib/instrumentor/base/DynatraceInternal.js +0 -34
- package/lib/instrumentor/base/Logger.js +0 -16
- package/lib/instrumentor/base/model/LogLevel.js +0 -17
- package/lib/jsx-dev-runtime.js +0 -70
- package/lib/jsx-runtime.js +0 -69
- package/lib/react/Component.js +0 -90
- package/lib/react-native/Touchables.InstrInfo.js +0 -60
- /package/{lib/instrumentor/base/interface → instrumentation/jsx}/IDynatraceProperties.js +0 -0
- /package/{lib → instrumentation/libs}/community/gesture-handler/index.js +0 -0
- /package/{lib → instrumentation/libs}/gesture-handler.js +0 -0
- /package/{lib → instrumentation/libs}/react-native/index.js +0 -0
- /package/{lib → instrumentation/libs}/react-native.js +0 -0
- /package/{lib/instrumentor → instrumentation}/model/Reference.js +0 -0
- /package/{lib/instrumentor → instrumentation}/parser/Babel.js +0 -0
- /package/lib/{instrumentor/base → core}/DynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base → core}/NullAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/UserPrivacyOptions.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationBuilder.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationPreset.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/IConfiguration.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatrace.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceInternal.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base/interface → core/logging}/ILogger.js +0 -0
- /package/lib/{instrumentor/base → core}/model/DataCollectionLevel.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Json.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Platform.js +0 -0
- /package/lib/{instrumentor/base → core}/util/StringUtils.js +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNameForType = exports.isTypeTouchable = exports.isTypeGestureHandlerTouchable = exports.isTypeReactNativeTouchable = void 0;
|
|
4
|
+
const Types_1 = require("./Types");
|
|
5
|
+
const isTypeReactNativeTouchable = (type) => type === Types_1.Types.TouchableHighlight ||
|
|
6
|
+
type === Types_1.Types.TouchableNativeFeedback ||
|
|
7
|
+
type === Types_1.Types.TouchableOpacity ||
|
|
8
|
+
type === Types_1.Types.TouchableWithoutFeedback;
|
|
9
|
+
exports.isTypeReactNativeTouchable = isTypeReactNativeTouchable;
|
|
10
|
+
const isTypeGestureHandlerTouchable = (type) => type === Types_1.Types.TouchableHighlightGestureHandler ||
|
|
11
|
+
type === Types_1.Types.TouchableNativeFeedbackGestureHandler ||
|
|
12
|
+
type === Types_1.Types.TouchableOpacityGestureHandler ||
|
|
13
|
+
type === Types_1.Types.TouchableWithoutFeedbackGestureHandler ||
|
|
14
|
+
type === Types_1.Types.RectButtonGestureHandler;
|
|
15
|
+
exports.isTypeGestureHandlerTouchable = isTypeGestureHandlerTouchable;
|
|
16
|
+
const isTypeTouchable = (type) => (0, exports.isTypeGestureHandlerTouchable)(type) || (0, exports.isTypeReactNativeTouchable)(type);
|
|
17
|
+
exports.isTypeTouchable = isTypeTouchable;
|
|
18
|
+
const getNameForType = (type) => {
|
|
19
|
+
switch (type) {
|
|
20
|
+
case Types_1.Types.Button:
|
|
21
|
+
case Types_1.Types.RectButtonGestureHandler:
|
|
22
|
+
return 'Button';
|
|
23
|
+
case Types_1.Types.Text:
|
|
24
|
+
return 'Text';
|
|
25
|
+
case Types_1.Types.TouchableHighlight:
|
|
26
|
+
case Types_1.Types.TouchableNativeFeedback:
|
|
27
|
+
case Types_1.Types.TouchableOpacity:
|
|
28
|
+
case Types_1.Types.TouchableWithoutFeedback:
|
|
29
|
+
case Types_1.Types.TouchableHighlightGestureHandler:
|
|
30
|
+
case Types_1.Types.TouchableNativeFeedbackGestureHandler:
|
|
31
|
+
case Types_1.Types.TouchableOpacityGestureHandler:
|
|
32
|
+
case Types_1.Types.TouchableWithoutFeedbackGestureHandler:
|
|
33
|
+
return 'Touchable';
|
|
34
|
+
case Types_1.Types.Pressable:
|
|
35
|
+
return 'Pressable';
|
|
36
|
+
case Types_1.Types.Picker:
|
|
37
|
+
return 'Picker';
|
|
38
|
+
case Types_1.Types.RefreshControl:
|
|
39
|
+
return 'Refresh Control';
|
|
40
|
+
case Types_1.Types.Switch:
|
|
41
|
+
return 'Switch';
|
|
42
|
+
case Types_1.Types.ClassComponent:
|
|
43
|
+
return 'Class Component';
|
|
44
|
+
case Types_1.Types.FunctionalComponent:
|
|
45
|
+
return 'Functional Component';
|
|
46
|
+
default:
|
|
47
|
+
return 'Undefined';
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.getNameForType = getNameForType;
|
package/ios/DynatraceRNBridge.h
CHANGED
|
@@ -7,13 +7,18 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Dynatrace/Dynatrace.h>
|
|
9
9
|
#import <React/RCTBridgeModule.h>
|
|
10
|
+
#import <React/RCTEventEmitter.h>
|
|
10
11
|
|
|
11
|
-
@interface DynatraceRNBridge :
|
|
12
|
+
@interface DynatraceRNBridge : RCTEventEmitter <RCTBridgeModule>
|
|
12
13
|
- (void) newAction:(NSString *)name key:(NSString *)key parentAction:(DTXAction *)parentAction;
|
|
13
14
|
- (DTXAction *) getAction:(NSString *)key;
|
|
14
15
|
- (BOOL) shouldWorkOnIosWithPlatform: (NSString *) platform;
|
|
15
16
|
@end
|
|
16
17
|
|
|
18
|
+
@interface HybridBridge : NSObject
|
|
19
|
+
+ (void)forwardEvent:(NSDictionary<NSString*,id>* _Nullable)fields NS_SWIFT_NAME(forwardEvent(fields:));
|
|
20
|
+
@end
|
|
21
|
+
|
|
17
22
|
typedef enum : NSUInteger {
|
|
18
23
|
DTXActionPlatformJavaScript = 1,
|
|
19
24
|
DTXActionPlatformXamarin,
|
|
@@ -27,6 +32,10 @@ typedef enum : NSUInteger {
|
|
|
27
32
|
- (DTX_StatusCode)reportExternalErrorForPlatformType:(DTXActionPlatformType)platformType errorName:(NSString*)errorName errorValue:(NSString*)errorValue reason:(NSString*)reason stacktrace:(NSString*)stacktrace;
|
|
28
33
|
@end
|
|
29
34
|
|
|
35
|
+
@interface DTXAction (CrossPlatform)
|
|
36
|
+
- (DTX_StatusCode)internalReportError:(NSString* _Nonnull)errorName errorValue:(int)errorValue;
|
|
37
|
+
@end
|
|
38
|
+
|
|
30
39
|
@interface Dynatrace (Events)
|
|
31
40
|
+ (void)sendBizEventWithType:(NSString *)type attributes:(NSDictionary<NSString *, id> *_Nullable)attributes;
|
|
32
41
|
@end
|
package/ios/DynatraceRNBridge.mm
CHANGED
|
@@ -11,18 +11,46 @@
|
|
|
11
11
|
|
|
12
12
|
#import <Foundation/Foundation.h>
|
|
13
13
|
#import <CoreLocation/CoreLocation.h>
|
|
14
|
+
#import <React/RCTPerformanceLogger.h>
|
|
15
|
+
#import <React/RCTRootView.h>
|
|
14
16
|
|
|
15
17
|
@implementation DynatraceRNBridge
|
|
16
18
|
|
|
17
19
|
NSMutableDictionary *actionDict;
|
|
18
20
|
NSMutableDictionary *webTimingsDict;
|
|
19
21
|
|
|
22
|
+
// Platform types
|
|
20
23
|
NSString *const PlatformAndroid = @"android";
|
|
21
24
|
NSString *const PlatformiOS = @"ios";
|
|
25
|
+
|
|
26
|
+
// Data collection levels
|
|
22
27
|
NSString *const DataCollectionOff = @"OFF";
|
|
23
28
|
NSString *const DataCollectionPerformance = @"PERFORMANCE";
|
|
24
29
|
NSString *const DataCollectionUserBehavior = @"USER_BEHAVIOR";
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Emitting app start event with this identifier
|
|
33
|
+
*/
|
|
34
|
+
NSString *const EmitAppMeasurementsIdentifier = @"dynatraceAppStartMeasurements";
|
|
35
|
+
|
|
36
|
+
// All types which are interesting for us
|
|
37
|
+
NSString *const DownloadStart = @"downloadStart";
|
|
38
|
+
NSString *const DownloadEnd = @"downloadEnd";
|
|
39
|
+
NSString *const RunJSBundleStart = @"runJsBundleStart";
|
|
40
|
+
NSString *const RunJSBundleEnd = @"runJsBundleEnd";
|
|
41
|
+
NSString *const Reload = @"reload";
|
|
42
|
+
NSString *const ContentAppeared = @"contentAppeared";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Telling us if we can actually emit events
|
|
46
|
+
*/
|
|
47
|
+
bool hasListeners = NO;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* When events have been emitted this value will be true, so we don't emit again
|
|
51
|
+
*/
|
|
52
|
+
bool didEmit = NO;
|
|
53
|
+
|
|
26
54
|
RCT_EXPORT_MODULE(DynatraceBridge);
|
|
27
55
|
|
|
28
56
|
- (id) init
|
|
@@ -35,6 +63,114 @@ RCT_EXPORT_MODULE(DynatraceBridge);
|
|
|
35
63
|
return self;
|
|
36
64
|
}
|
|
37
65
|
|
|
66
|
+
- (NSArray<NSString *> *)supportedEvents {
|
|
67
|
+
return @[EmitAppMeasurementsIdentifier];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* When bridge is starting we will add an observer for content did appear so we can emit our app start measurements
|
|
72
|
+
*/
|
|
73
|
+
- (void)setBridge:(RCTBridge *)bridge
|
|
74
|
+
{
|
|
75
|
+
[super setBridge:bridge];
|
|
76
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
77
|
+
selector:@selector(emitMeasurements)
|
|
78
|
+
name:RCTContentDidAppearNotification
|
|
79
|
+
object:nil];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Emitting all events which are available and important for our app start measurements
|
|
84
|
+
*/
|
|
85
|
+
- (void)emitMeasurements
|
|
86
|
+
{
|
|
87
|
+
if (!didEmit && hasListeners && [self.bridge.performanceLogger valueForTag:RCTPLTTI] != 0) {
|
|
88
|
+
didEmit = YES;
|
|
89
|
+
|
|
90
|
+
NSMutableDictionary<NSString*, NSNumber*> *appStartMeasurements = [[NSMutableDictionary alloc] init];
|
|
91
|
+
|
|
92
|
+
[self addStartMeasurement:RCTPLScriptDownload withName:DownloadStart intoDict:appStartMeasurements];
|
|
93
|
+
[self addEndMeasurement:RCTPLScriptDownload withName:DownloadEnd intoDict:appStartMeasurements];
|
|
94
|
+
[self addStartMeasurement:RCTPLScriptExecution withName:RunJSBundleStart intoDict:appStartMeasurements];
|
|
95
|
+
[self addEndMeasurement:RCTPLScriptExecution withName:RunJSBundleEnd intoDict:appStartMeasurements];
|
|
96
|
+
[self addStartMeasurement:RCTPLBridgeStartup withName:Reload intoDict:appStartMeasurements];
|
|
97
|
+
[self addStartMeasurement:RCTPLTTI withName:ContentAppeared intoDict:appStartMeasurements];
|
|
98
|
+
|
|
99
|
+
if (hasListeners) {
|
|
100
|
+
[self sendEventWithName:EmitAppMeasurementsIdentifier body:appStartMeasurements];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Adding a start measurement
|
|
107
|
+
*
|
|
108
|
+
* @param type Tag which is used for the internal react native performance logger
|
|
109
|
+
* @param name Name which should be used for inserting a specific timestamp into the dict
|
|
110
|
+
* @param measurements Dictionary which is used to insert the timing
|
|
111
|
+
*/
|
|
112
|
+
- (void)addStartMeasurement:(RCTPLTag)type withName:(NSString *)name intoDict:(NSMutableDictionary *) measurements {
|
|
113
|
+
int64_t duration = [self.bridge.performanceLogger durationForTag:type];
|
|
114
|
+
int64_t end = [self.bridge.performanceLogger valueForTag:type];
|
|
115
|
+
|
|
116
|
+
if (duration == 0 || end == 0) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[measurements setObject:[self correctionOfTimestamp:end-duration] forKey:name];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Adding a end measurement
|
|
125
|
+
*
|
|
126
|
+
* @param type Tag which is used for the internal react native performance logger
|
|
127
|
+
* @param name Name which should be used for inserting a specific timestamp into the dict
|
|
128
|
+
* @param measurements Dictionary which is used to insert the timing
|
|
129
|
+
*/
|
|
130
|
+
- (void)addEndMeasurement:(RCTPLTag)type withName:(NSString *)name intoDict:(NSMutableDictionary *) measurements {
|
|
131
|
+
int64_t end = [self.bridge.performanceLogger valueForTag:type];
|
|
132
|
+
|
|
133
|
+
if (end == 0) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[measurements setObject:[self correctionOfTimestamp:end] forKey:name];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (NSNumber* )correctionOfTimestamp:(int64_t) timestamp
|
|
141
|
+
{
|
|
142
|
+
return [NSNumber numberWithLongLong:timestamp + [[NSDate date] timeIntervalSince1970] - (CACurrentMediaTime() * 1000)];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Invalidation should remove the observer for certain events
|
|
147
|
+
*/
|
|
148
|
+
- (void)invalidate
|
|
149
|
+
{
|
|
150
|
+
[super invalidate];
|
|
151
|
+
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Triggered when starting to emit events
|
|
156
|
+
*/
|
|
157
|
+
- (void)startObserving
|
|
158
|
+
{
|
|
159
|
+
hasListeners = YES;
|
|
160
|
+
[self emitMeasurements];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Triggered when stopping to emit events
|
|
165
|
+
*/
|
|
166
|
+
-(void)stopObserving
|
|
167
|
+
{
|
|
168
|
+
hasListeners = NO;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Constants which are exported to the JS part
|
|
173
|
+
*/
|
|
38
174
|
- (NSDictionary *)constantsToExport
|
|
39
175
|
{
|
|
40
176
|
return @{ @"PLATFORM_ANDROID" : PlatformAndroid,
|
|
@@ -154,6 +290,16 @@ RCT_EXPORT_METHOD(endVisit: (NSString *) platform)
|
|
|
154
290
|
}
|
|
155
291
|
}
|
|
156
292
|
|
|
293
|
+
RCT_EXPORT_METHOD(startView: (NSString *) name)
|
|
294
|
+
{
|
|
295
|
+
[Dynatrace startViewWithName:name];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
RCT_EXPORT_METHOD(stopView)
|
|
299
|
+
{
|
|
300
|
+
[Dynatrace stopView];
|
|
301
|
+
}
|
|
302
|
+
|
|
157
303
|
RCT_EXPORT_METHOD(reportErrorWithoutStacktrace:(NSString *)errorName errorCode:(nonnull NSNumber *)errorCode platform: (NSString *) platform)
|
|
158
304
|
{
|
|
159
305
|
if ([self shouldWorkOnIosWithPlatform: platform])
|
|
@@ -210,7 +356,7 @@ RCT_EXPORT_METHOD(reportErrorInAction:(nonnull NSString *)key errorName:(NSStrin
|
|
|
210
356
|
DTXAction *action = [self getAction:key];
|
|
211
357
|
if (action == nil)
|
|
212
358
|
return;
|
|
213
|
-
[action
|
|
359
|
+
[action internalReportError:errorName errorValue:[errorCode intValue]];
|
|
214
360
|
}
|
|
215
361
|
}
|
|
216
362
|
|
|
@@ -309,6 +455,11 @@ RCT_EXPORT_METHOD(sendBizEvent:(NSString *)type withAttributes:(NSDictionary<NSS
|
|
|
309
455
|
}
|
|
310
456
|
}
|
|
311
457
|
|
|
458
|
+
RCT_EXPORT_METHOD(forwardEvent:(NSDictionary<NSString*, id>*) attributes)
|
|
459
|
+
{
|
|
460
|
+
[HybridBridge forwardEvent:attributes];
|
|
461
|
+
}
|
|
462
|
+
|
|
312
463
|
RCT_EXPORT_METHOD(setGPSLocation:(double)latitude andLongitude: (double)longitude platform: (NSString *) platform)
|
|
313
464
|
{
|
|
314
465
|
if ([self shouldWorkOnIosWithPlatform: platform])
|
package/jsx-dev-runtime.js
CHANGED
package/jsx-runtime.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationHandler = void 0;
|
|
4
|
+
const ConfigurationBuilder_1 = require("./configuration/ConfigurationBuilder");
|
|
5
|
+
const ConfigurationHandler_1 = require("./configuration/ConfigurationHandler");
|
|
6
|
+
const ConsoleLogger_1 = require("./logging/ConsoleLogger");
|
|
7
|
+
const logger = new ConsoleLogger_1.ConsoleLogger('ApplicationHandler');
|
|
8
|
+
exports.ApplicationHandler = {
|
|
9
|
+
startup: (configuration) => {
|
|
10
|
+
if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
11
|
+
let config = configuration;
|
|
12
|
+
if (config === undefined) {
|
|
13
|
+
config = new ConfigurationBuilder_1.ConfigurationBuilder('', '').buildConfiguration();
|
|
14
|
+
}
|
|
15
|
+
ConfigurationHandler_1.ConfigurationHandler.setConfiguration(config);
|
|
16
|
+
logger.debug('Configuration set: ' + config.toString());
|
|
17
|
+
logger.info('Dynatrace React Native Plugin started!');
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -10,12 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Dynatrace = void 0;
|
|
13
|
-
const Types_1 = require("
|
|
13
|
+
const Types_1 = require("../../instrumentation/model/Types");
|
|
14
|
+
const DynatraceSecondGenForwarder_1 = require("../next/DynatraceSecondGenForwarder");
|
|
15
|
+
const Dynatrace_1 = require("../next/Dynatrace");
|
|
14
16
|
const StringUtils_1 = require("./util/StringUtils");
|
|
15
17
|
const DynatraceBridge_1 = require("./DynatraceBridge");
|
|
16
18
|
const DataCollectionLevel_1 = require("./model/DataCollectionLevel");
|
|
17
19
|
const UserPrivacyOptions_1 = require("./UserPrivacyOptions");
|
|
18
|
-
const
|
|
20
|
+
const ConsoleLogger_1 = require("./logging/ConsoleLogger");
|
|
19
21
|
const ConfigurationHandler_1 = require("./configuration/ConfigurationHandler");
|
|
20
22
|
const DynatraceRootAction_1 = require("./DynatraceRootAction");
|
|
21
23
|
const NullRootAction_1 = require("./NullRootAction");
|
|
@@ -23,6 +25,8 @@ const DynatraceInternal_1 = require("./DynatraceInternal");
|
|
|
23
25
|
const DynatraceAction_1 = require("./DynatraceAction");
|
|
24
26
|
const NullAction_1 = require("./NullAction");
|
|
25
27
|
const ErrorHandler_1 = require("./ErrorHandler");
|
|
28
|
+
const Application_1 = require("./Application");
|
|
29
|
+
const logger = new ConsoleLogger_1.ConsoleLogger('Dynatrace');
|
|
26
30
|
exports.Dynatrace = {
|
|
27
31
|
start: (configuration) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
32
|
if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
@@ -32,15 +36,16 @@ exports.Dynatrace = {
|
|
|
32
36
|
(0, ErrorHandler_1.registerErrorHandler)(configuration.reportFatalErrorAsCrash);
|
|
33
37
|
}
|
|
34
38
|
else {
|
|
35
|
-
|
|
39
|
+
logger.debug('Dynatrace error handler will not be enabled as errorHandler was set to false!');
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
Logger_1.Logger.logDebug('Configuration set: ' + configuration.toString());
|
|
41
|
+
Application_1.ApplicationHandler.startup(configuration);
|
|
39
42
|
}
|
|
40
43
|
else {
|
|
41
44
|
throw new Error('Configuration is empty! Not allowed for Manual Startup!');
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
logger.debug('Configuration is already available! Duplicated startup blocked.');
|
|
44
49
|
}
|
|
45
50
|
}),
|
|
46
51
|
withMonitoring: (Component, name) => {
|
|
@@ -75,17 +80,17 @@ exports.Dynatrace = {
|
|
|
75
80
|
key = 'DEFAULT_' + DynatraceInternal_1.DynatraceInternal.getCounter();
|
|
76
81
|
}
|
|
77
82
|
if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(name)) {
|
|
78
|
-
|
|
83
|
+
logger.debug(`enterManualAction(${name})`);
|
|
79
84
|
DynatraceBridge_1.DynatraceNative.enterManualAction(name, key, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
80
85
|
return new DynatraceRootAction_1.DynatraceRootAction(key, name);
|
|
81
86
|
}
|
|
82
87
|
else {
|
|
83
|
-
|
|
88
|
+
logger.debug('Action Name was empty or null! Action will have no effect.');
|
|
84
89
|
return new NullRootAction_1.NullRootAction();
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
else {
|
|
88
|
-
|
|
93
|
+
logger.info(`enterManualAction(${name}): React Native plugin has not been started yet! Action can't be created!`);
|
|
89
94
|
return new NullRootAction_1.NullRootAction();
|
|
90
95
|
}
|
|
91
96
|
},
|
|
@@ -102,27 +107,28 @@ exports.Dynatrace = {
|
|
|
102
107
|
key = 'DEFAULT_' + DynatraceInternal_1.DynatraceInternal.getCounter();
|
|
103
108
|
}
|
|
104
109
|
if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(name)) {
|
|
105
|
-
|
|
110
|
+
logger.debug(`enterAutoAction(${name})`);
|
|
106
111
|
DynatraceBridge_1.DynatraceNative.enterAction(name, key, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
107
112
|
return new DynatraceAction_1.DynatraceAction(key, name, false);
|
|
108
113
|
}
|
|
109
114
|
else {
|
|
110
|
-
|
|
115
|
+
logger.debug('Action Name was empty or null! Action will have no effect.');
|
|
111
116
|
return new NullAction_1.NullAction();
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
else {
|
|
115
|
-
|
|
120
|
+
logger.info(`enterAutoAction(${name}): React Native plugin has not been started yet! Action can't be created!`);
|
|
116
121
|
return new NullAction_1.NullAction();
|
|
117
122
|
}
|
|
118
123
|
},
|
|
119
124
|
reportError: (errorName, errorCode, platform) => {
|
|
120
125
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
121
|
-
|
|
126
|
+
logger.debug(`reportError(${errorName}, ${errorCode})`);
|
|
122
127
|
DynatraceBridge_1.DynatraceNative.reportErrorWithoutStacktrace(errorName, errorCode, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
128
|
+
DynatraceSecondGenForwarder_1.DynatraceSecondGenForwarder.reportError(errorName, errorCode);
|
|
123
129
|
}
|
|
124
130
|
else {
|
|
125
|
-
|
|
131
|
+
logger.info(`reportError(${errorName}, ${errorCode}): React Native plugin has not been started yet! Error will not be reported!`);
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
reportErrorWithStacktrace: (errorName, reason, stacktrace, platform) => {
|
|
@@ -133,11 +139,12 @@ exports.Dynatrace = {
|
|
|
133
139
|
reason = reason.substring(0, reasonNewLineIndex);
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
|
-
|
|
142
|
+
logger.debug(`reportErrorStacktrace(${errorName}, ${reason}, ${stacktrace})`);
|
|
137
143
|
DynatraceBridge_1.DynatraceNative.reportError(errorName, '-', reason, stacktrace, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
144
|
+
DynatraceSecondGenForwarder_1.DynatraceSecondGenForwarder.reportErrorWithStacktrace(errorName, reason, stacktrace);
|
|
138
145
|
}
|
|
139
146
|
else {
|
|
140
|
-
|
|
147
|
+
logger.info(`reportErrorStacktrace(${errorName}, ${reason}, ${stacktrace}): React Native plugin has not been started yet! Error will not be reported!`);
|
|
141
148
|
}
|
|
142
149
|
},
|
|
143
150
|
reportErrorStacktrace: (errorName, errorValue, reason, stacktrace, platform) => {
|
|
@@ -148,11 +155,12 @@ exports.Dynatrace = {
|
|
|
148
155
|
reason = reason.substring(0, reasonNewLineIndex);
|
|
149
156
|
}
|
|
150
157
|
}
|
|
151
|
-
|
|
158
|
+
logger.debug(`reportErrorStacktrace(${errorName}, ${errorValue}, ${reason}, ${stacktrace})`);
|
|
152
159
|
DynatraceBridge_1.DynatraceNative.reportError(errorName, errorValue, reason, stacktrace, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
160
|
+
DynatraceSecondGenForwarder_1.DynatraceSecondGenForwarder.reportErrorStacktrace(errorName, errorValue, reason, stacktrace);
|
|
153
161
|
}
|
|
154
162
|
else {
|
|
155
|
-
|
|
163
|
+
logger.info(`reportErrorStacktrace(${errorName}, ${errorValue}, ${reason}, ${stacktrace}): React Native plugin has not been started yet! Error will not be reported!`);
|
|
156
164
|
}
|
|
157
165
|
},
|
|
158
166
|
reportCrash: (crashName, reason, stacktrace, platform) => {
|
|
@@ -164,12 +172,13 @@ exports.Dynatrace = {
|
|
|
164
172
|
reason = reason.substring(0, reasonNewLineIndex);
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
|
-
|
|
175
|
+
logger.debug(`reportCrash(${crashName}, ${reason}, ${stacktrace})`);
|
|
168
176
|
DynatraceBridge_1.DynatraceNative.reportCrash(crashName, reason, stacktrace, false, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
177
|
+
DynatraceSecondGenForwarder_1.DynatraceSecondGenForwarder.reportCrash(crashName, reason, stacktrace);
|
|
169
178
|
}
|
|
170
179
|
}
|
|
171
180
|
else {
|
|
172
|
-
|
|
181
|
+
logger.info(`reportCrash(${crashName}, ${reason}, ${stacktrace}): React Native plugin has not been started yet! Crash will not be reported!`);
|
|
173
182
|
}
|
|
174
183
|
},
|
|
175
184
|
reportCrashWithException: (crashName, crash, platform) => {
|
|
@@ -183,108 +192,109 @@ exports.Dynatrace = {
|
|
|
183
192
|
crashReason = crashReason.substring(0, reasonNewLineIndex);
|
|
184
193
|
}
|
|
185
194
|
}
|
|
186
|
-
|
|
195
|
+
logger.debug(`reportCrashWithException(${crashName}, ${crash.stack})`);
|
|
187
196
|
DynatraceBridge_1.DynatraceNative.reportCrash(crashName, crashReason, crash.stack, true, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
197
|
+
DynatraceSecondGenForwarder_1.DynatraceSecondGenForwarder.reportCrashWithException(crashName, crash);
|
|
188
198
|
}
|
|
189
199
|
}
|
|
190
200
|
else {
|
|
191
|
-
|
|
201
|
+
logger.info(`reportCrashWithException(${crashName}, ${crash}): React Native plugin has not been started yet! Crash will not be reported!`);
|
|
192
202
|
}
|
|
193
203
|
},
|
|
194
204
|
sendBizEvent: (type, attributes = {}, platform) => {
|
|
195
205
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
196
206
|
if (StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(type)) {
|
|
197
|
-
|
|
207
|
+
logger.debug(`sendBizEvent(${type}, ${attributes})): Type must be a non empty string`);
|
|
198
208
|
return;
|
|
199
209
|
}
|
|
200
210
|
if (typeof attributes !== 'object' ||
|
|
201
211
|
attributes === null ||
|
|
202
212
|
Array.isArray(attributes)) {
|
|
203
|
-
|
|
213
|
+
logger.debug(`sendBizEvent(${type}, ${attributes})): Payload toplevel must be an object`);
|
|
204
214
|
return;
|
|
205
215
|
}
|
|
206
216
|
const internalAttributes = Object.assign({}, attributes);
|
|
207
|
-
|
|
217
|
+
logger.debug(`sendBizEvent(${type}, ${internalAttributes})`);
|
|
208
218
|
DynatraceBridge_1.DynatraceNative.sendBizEvent(type, internalAttributes, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
209
219
|
}
|
|
210
220
|
else {
|
|
211
|
-
|
|
221
|
+
logger.info(`sendBizEvent(${type}, ${attributes}): React Native plugin has not been started yet! Biz Event will not be reported!`);
|
|
212
222
|
}
|
|
213
223
|
},
|
|
214
224
|
endSession: (platform) => {
|
|
215
225
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
216
|
-
|
|
226
|
+
logger.debug('Dynatrace endSession()');
|
|
217
227
|
DynatraceBridge_1.DynatraceNative.endVisit(platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
218
228
|
}
|
|
219
229
|
else {
|
|
220
|
-
|
|
230
|
+
logger.info('endSession(): React Native plugin has not been started yet! Session will not be ended!');
|
|
221
231
|
}
|
|
222
232
|
},
|
|
223
233
|
identifyUser: (user, platform) => {
|
|
224
234
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
225
|
-
|
|
235
|
+
logger.debug(`Dynatrace identifyUser(${user})`);
|
|
226
236
|
DynatraceBridge_1.DynatraceNative.identifyUser(user, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
227
237
|
}
|
|
228
238
|
else {
|
|
229
|
-
|
|
239
|
+
logger.info(`identifyUser(${user}): React Native plugin has not been started yet! Session will not be tagged!`);
|
|
230
240
|
}
|
|
231
241
|
},
|
|
232
242
|
setGPSLocation: (latitude, longitude, platform) => {
|
|
233
243
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
234
|
-
|
|
244
|
+
logger.debug(`setGPSLocation(${latitude}, ${longitude})`);
|
|
235
245
|
DynatraceBridge_1.DynatraceNative.setGPSLocation(latitude, longitude, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
236
246
|
}
|
|
237
247
|
else {
|
|
238
|
-
|
|
248
|
+
logger.info(`setGPSLocation(${latitude}, ${longitude}): React Native plugin has not been started yet! GPS Position will not be set!`);
|
|
239
249
|
}
|
|
240
250
|
},
|
|
241
251
|
isCrashReportingOptedIn: (platform) => __awaiter(void 0, void 0, void 0, function* () {
|
|
242
252
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
243
|
-
|
|
253
|
+
logger.debug('Dynatrace isCrashReportingOptedIn()');
|
|
244
254
|
return DynatraceBridge_1.DynatraceNative.isCrashReportingOptedIn(platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
245
255
|
}
|
|
246
256
|
else {
|
|
247
|
-
|
|
257
|
+
logger.info('isCrashReportingOptedIn(): React Native plugin has not been started yet! Crash reporting value not available!');
|
|
248
258
|
return false;
|
|
249
259
|
}
|
|
250
260
|
}),
|
|
251
261
|
setCrashReportingOptedIn: (crashReporting, platform) => {
|
|
252
262
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
253
|
-
|
|
263
|
+
logger.debug(`setCrashReportingOptedIn(${crashReporting})`);
|
|
254
264
|
DynatraceBridge_1.DynatraceNative.setCrashReportingOptedIn(crashReporting, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
255
265
|
}
|
|
256
266
|
else {
|
|
257
|
-
|
|
267
|
+
logger.info(`setCrashReportingOptedIn(${crashReporting}): React Native plugin has not been started yet! Crash reporting value will not be set!`);
|
|
258
268
|
}
|
|
259
269
|
},
|
|
260
270
|
getDataCollectionLevel: (platform) => __awaiter(void 0, void 0, void 0, function* () {
|
|
261
271
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
262
|
-
|
|
272
|
+
logger.debug('getDataCollectionLevel()');
|
|
263
273
|
return (0, DataCollectionLevel_1.StringToDataCollectionLevel)(yield DynatraceBridge_1.DynatraceNative.getDataCollectionLevel(platform === null || platform === void 0 ? void 0 : platform.toString()));
|
|
264
274
|
}
|
|
265
275
|
else {
|
|
266
|
-
|
|
276
|
+
logger.info('getDataCollectionLevel(): React Native plugin has not been started yet! Data Collection level not available!');
|
|
267
277
|
return DataCollectionLevel_1.DataCollectionLevel.Off;
|
|
268
278
|
}
|
|
269
279
|
}),
|
|
270
280
|
setDataCollectionLevel: (dataCollectionLevel, platform) => {
|
|
271
281
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
272
|
-
|
|
282
|
+
logger.debug(`setDataCollectionLevel(${dataCollectionLevel})`);
|
|
273
283
|
DynatraceBridge_1.DynatraceNative.setDataCollectionLevel(dataCollectionLevel.toString(), platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
274
284
|
}
|
|
275
285
|
else {
|
|
276
|
-
|
|
286
|
+
logger.info(`setDataCollectionLevel(${dataCollectionLevel}): React Native plugin has not been started yet! Data Collection level will not be set!`);
|
|
277
287
|
}
|
|
278
288
|
},
|
|
279
289
|
getUserPrivacyOptions: (platform) => __awaiter(void 0, void 0, void 0, function* () {
|
|
280
290
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
281
|
-
|
|
291
|
+
logger.debug('getUserPrivacyOptions()');
|
|
282
292
|
const options = yield DynatraceBridge_1.DynatraceNative.getUserPrivacyOptions(platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
283
293
|
const currentOptions = new UserPrivacyOptions_1.UserPrivacyOptions((0, DataCollectionLevel_1.StringToDataCollectionLevel)(options.dataCollectionLevel), options.crashReportingOptedIn);
|
|
284
294
|
return currentOptions;
|
|
285
295
|
}
|
|
286
296
|
else {
|
|
287
|
-
|
|
297
|
+
logger.info('getUserPrivacyOptions(): React Native plugin has not been started yet! User Privacy Options are not available!');
|
|
288
298
|
return new UserPrivacyOptions_1.UserPrivacyOptions(DataCollectionLevel_1.DataCollectionLevel.Off, false);
|
|
289
299
|
}
|
|
290
300
|
}),
|
|
@@ -293,26 +303,26 @@ exports.Dynatrace = {
|
|
|
293
303
|
if ((userPrivacyOptions.crashReportingOptedIn === true ||
|
|
294
304
|
userPrivacyOptions.crashReportingOptedIn === false) &&
|
|
295
305
|
userPrivacyOptions.dataCollectionLevel in DataCollectionLevel_1.DataCollectionLevel) {
|
|
296
|
-
|
|
306
|
+
logger.debug(`applyUserPrivacyOptions(${JSON.stringify(userPrivacyOptions)})`);
|
|
297
307
|
DynatraceBridge_1.DynatraceNative.applyUserPrivacyOptions(userPrivacyOptions, platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
298
308
|
}
|
|
299
309
|
}
|
|
300
310
|
else {
|
|
301
|
-
|
|
311
|
+
logger.info(`applyUserPrivacyOptions(${JSON.stringify(userPrivacyOptions)}): React Native plugin has not been started yet! User Privacy Options can't be applied!`);
|
|
302
312
|
}
|
|
303
313
|
},
|
|
304
314
|
flushEvents: (platform) => {
|
|
305
315
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
306
|
-
|
|
316
|
+
logger.debug('flushEvents()');
|
|
307
317
|
DynatraceBridge_1.DynatraceNative.flushEvents(platform === null || platform === void 0 ? void 0 : platform.toString());
|
|
308
318
|
}
|
|
309
319
|
else {
|
|
310
|
-
|
|
320
|
+
logger.info('flushEvents(): React Native plugin has not been started yet! Flushing Event not possible!');
|
|
311
321
|
}
|
|
312
322
|
},
|
|
313
323
|
setBeaconHeaders: (headers, platform) => {
|
|
314
324
|
if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
315
|
-
|
|
325
|
+
logger.debug('setBeaconHeaders(headers)');
|
|
316
326
|
if (headers && headers.size > 0) {
|
|
317
327
|
const obj = {};
|
|
318
328
|
headers.forEach((value, key) => (obj[key] = value));
|
|
@@ -323,7 +333,21 @@ exports.Dynatrace = {
|
|
|
323
333
|
}
|
|
324
334
|
}
|
|
325
335
|
else {
|
|
326
|
-
|
|
336
|
+
logger.info('setBeaconHeaders(headers): React Native plugin has not been started yet! Setting Beacon Headers is not possible!');
|
|
327
337
|
}
|
|
328
338
|
},
|
|
339
|
+
addEventModifier: (eventModifier) => Dynatrace_1.Dynatrace.addEventModifier(eventModifier),
|
|
340
|
+
removeEventModifier: (eventModifier) => Dynatrace_1.Dynatrace.removeEventModifier(eventModifier),
|
|
341
|
+
sendEvent: (properties) => {
|
|
342
|
+
Dynatrace_1.Dynatrace.sendEvent(properties);
|
|
343
|
+
},
|
|
344
|
+
startView: (name) => {
|
|
345
|
+
Dynatrace_1.Dynatrace.startView(name);
|
|
346
|
+
},
|
|
347
|
+
stopView: () => {
|
|
348
|
+
Dynatrace_1.Dynatrace.stopView();
|
|
349
|
+
},
|
|
350
|
+
sendSessionPropertyEvent: (properties) => {
|
|
351
|
+
Dynatrace_1.Dynatrace.sendSessionPropertyEvent(properties);
|
|
352
|
+
},
|
|
329
353
|
};
|