@truewatchtech/react-native-mobile 0.4.0-alpha.4 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/FTMobileReactNativeSDK.podspec +31 -2
  2. package/android/build.gradle +7 -19
  3. package/android/src/main/java/com/ft/sdk/reactnative/FTMobileImpl.java +472 -5
  4. package/android/src/main/java/com/ft/sdk/reactnative/FTRUMImpl.java +12 -0
  5. package/android/src/newarch/java/com/ft/sdk/reactnative/FTLogModule.java +7 -14
  6. package/android/src/newarch/java/com/ft/sdk/reactnative/FTMobileModule.java +46 -12
  7. package/android/src/newarch/java/com/ft/sdk/reactnative/FTRUMModule.java +12 -13
  8. package/android/src/newarch/java/com/ft/sdk/reactnative/FTTraceModule.java +6 -8
  9. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTMobileModule.java +34 -2
  10. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTRUMModule.java +5 -0
  11. package/android/src/rnpost74/java/com/ft/sdk/reactnative/FTMobilePackage.java +14 -3
  12. package/android/src/rnpre74/java/com/ft/sdk/reactnative/FTMobilePackage.java +0 -3
  13. package/ios/FTMobileReactNative.h +9 -5
  14. package/ios/FTMobileReactNative.mm +625 -0
  15. package/ios/FTReactNativeLog.h +8 -3
  16. package/ios/FTReactNativeLog.mm +79 -0
  17. package/ios/FTReactNativeRUM.h +8 -3
  18. package/ios/{FTReactNativeRUM.m → FTReactNativeRUM.mm} +143 -84
  19. package/ios/FTReactNativeTrace.h +8 -2
  20. package/ios/FTReactNativeTrace.mm +74 -0
  21. package/ios/FtMobileAgent.xcodeproj/project.pbxproj +17 -1
  22. package/lib/commonjs/ft_logger.js +14 -13
  23. package/lib/commonjs/ft_logger.js.map +1 -1
  24. package/lib/commonjs/ft_mobile_agent.js +155 -6
  25. package/lib/commonjs/ft_mobile_agent.js.map +1 -1
  26. package/lib/commonjs/ft_rum.js +55 -21
  27. package/lib/commonjs/ft_rum.js.map +1 -1
  28. package/lib/commonjs/ft_tracing.js +29 -10
  29. package/lib/commonjs/ft_tracing.js.map +1 -1
  30. package/lib/commonjs/index.js +24 -13
  31. package/lib/commonjs/index.js.map +1 -1
  32. package/lib/commonjs/rum/FTRumActionTracking.js +10 -4
  33. package/lib/commonjs/rum/FTRumActionTracking.js.map +1 -1
  34. package/lib/commonjs/rum/FTRumErrorTracking.js +4 -4
  35. package/lib/commonjs/rum/FTRumErrorTracking.js.map +1 -1
  36. package/lib/commonjs/specs/NativeFTMobileReactNative.js +10 -0
  37. package/lib/commonjs/specs/NativeFTMobileReactNative.js.map +1 -0
  38. package/lib/commonjs/specs/NativeFTReactNativeLog.js +10 -0
  39. package/lib/commonjs/specs/NativeFTReactNativeLog.js.map +1 -0
  40. package/lib/commonjs/specs/NativeFTReactNativeRUM.js +10 -0
  41. package/lib/commonjs/specs/NativeFTReactNativeRUM.js.map +1 -0
  42. package/lib/commonjs/specs/NativeFTReactNativeTrace.js +10 -0
  43. package/lib/commonjs/specs/NativeFTReactNativeTrace.js.map +1 -0
  44. package/lib/commonjs/version.js +1 -1
  45. package/lib/commonjs/version.js.map +1 -1
  46. package/lib/module/ft_logger.js +14 -12
  47. package/lib/module/ft_logger.js.map +1 -1
  48. package/lib/module/ft_mobile_agent.js +161 -5
  49. package/lib/module/ft_mobile_agent.js.map +1 -1
  50. package/lib/module/ft_rum.js +54 -16
  51. package/lib/module/ft_rum.js.map +1 -1
  52. package/lib/module/ft_tracing.js +29 -9
  53. package/lib/module/ft_tracing.js.map +1 -1
  54. package/lib/module/index.js +3 -4
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/rum/FTRumActionTracking.js +10 -4
  57. package/lib/module/rum/FTRumActionTracking.js.map +1 -1
  58. package/lib/module/rum/FTRumErrorTracking.js +4 -4
  59. package/lib/module/rum/FTRumErrorTracking.js.map +1 -1
  60. package/lib/module/specs/NativeFTMobileReactNative.js +5 -0
  61. package/lib/module/specs/NativeFTMobileReactNative.js.map +1 -0
  62. package/lib/module/specs/NativeFTReactNativeLog.js +5 -0
  63. package/lib/module/specs/NativeFTReactNativeLog.js.map +1 -0
  64. package/lib/module/specs/NativeFTReactNativeRUM.js +5 -0
  65. package/lib/module/specs/NativeFTReactNativeRUM.js.map +1 -0
  66. package/lib/module/specs/NativeFTReactNativeTrace.js +5 -0
  67. package/lib/module/specs/NativeFTReactNativeTrace.js.map +1 -0
  68. package/lib/module/version.js +1 -1
  69. package/lib/module/version.js.map +1 -1
  70. package/lib/typescript/ft_logger.d.ts +6 -6
  71. package/lib/typescript/ft_mobile_agent.d.ts +169 -14
  72. package/lib/typescript/ft_rum.d.ts +32 -8
  73. package/lib/typescript/ft_tracing.d.ts +6 -6
  74. package/lib/typescript/index.d.ts +3 -4
  75. package/lib/typescript/specs/NativeFTMobileReactNative.d.ts +75 -0
  76. package/lib/typescript/specs/NativeFTReactNativeLog.d.ts +23 -0
  77. package/lib/typescript/specs/NativeFTReactNativeRUM.d.ts +89 -0
  78. package/lib/typescript/specs/NativeFTReactNativeTrace.d.ts +24 -0
  79. package/lib/typescript/version.d.ts +1 -1
  80. package/package.json +26 -93
  81. package/scripts/replace-react-require.js +37 -38
  82. package/src/ft_logger.tsx +72 -40
  83. package/src/ft_mobile_agent.tsx +378 -91
  84. package/src/ft_rum.tsx +227 -121
  85. package/src/ft_tracing.tsx +58 -37
  86. package/src/index.tsx +58 -18
  87. package/src/rum/FTRumActionTracking.tsx +212 -204
  88. package/src/rum/FTRumErrorTracking.tsx +70 -71
  89. package/src/specs/NativeFTMobileReactNative.ts +83 -0
  90. package/src/specs/NativeFTReactNativeLog.ts +29 -0
  91. package/src/specs/NativeFTReactNativeRUM.ts +104 -0
  92. package/src/specs/NativeFTReactNativeTrace.ts +26 -0
  93. package/src/version.ts +1 -1
  94. package/LICENSE +0 -201
  95. package/android/.project +0 -17
  96. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  97. package/android/gradlew +0 -185
  98. package/android/local.properties +0 -8
  99. package/android/src/main/java/com/ft/sdk/InnerClassProxy.java +0 -8
  100. package/android/src/main/java/com/ft/sdk/reactnative/FTSessionReplayImpl.java +0 -60
  101. package/android/src/main/java/com/ft/sdk/reactnative/extensions/ReactDrawablesExt.java +0 -155
  102. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/NoopTextPropertiesResolver.java +0 -23
  103. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupport.java +0 -57
  104. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/ShadowNodeWrapper.java +0 -84
  105. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/TextPropertiesResolver.java +0 -20
  106. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/DefaultMapper.java +0 -78
  107. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/Pair.java +0 -11
  108. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/ReactEditTextMapper.java +0 -136
  109. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/ReactNativeImageViewMapper.java +0 -117
  110. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/ReactTextMapper.java +0 -57
  111. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/ReactViewGroupMapper.java +0 -22
  112. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/mappers/ReactViewModalMapper.java +0 -21
  113. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/resources/ReactDrawableCopier.java +0 -35
  114. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/utils/DrawableUtils.java +0 -34
  115. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/utils/ReflectionUtils.java +0 -43
  116. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/utils/text/FabricTextViewUtils.java +0 -69
  117. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/utils/text/LegacyTextViewUtils.java +0 -97
  118. package/android/src/main/java/com/ft/sdk/reactnative/sessionreplay/utils/text/TextViewUtils.java +0 -184
  119. package/android/src/main/java/com/ft/sdk/reactnative/utils/ColorUtils.java +0 -24
  120. package/android/src/newarch/java/com/ft/sdk/reactnative/FTSessionReplayModule.java +0 -30
  121. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTSessionReplayModule.java +0 -25
  122. package/android/src/rn69/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -100
  123. package/android/src/rn75/java/com/ft/sdk/reactnative/sessionreplay/extensions/LengthPercentageExt.java +0 -27
  124. package/android/src/rn75/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -116
  125. package/android/src/rn76/java/com/ft/sdk/reactnative/sessionreplay/extensions/LengthPercentageExt.java +0 -38
  126. package/android/src/rn76/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -117
  127. package/android/src/rn79/java/com/ft/sdk/reactnative/sessionreplay/extensions/LengthPercentageExt.java +0 -38
  128. package/android/src/rn79/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -132
  129. package/android/src/rn80/java/com/ft/sdk/reactnative/sessionreplay/extensions/ComputedBorderRadiusExt.java +0 -58
  130. package/android/src/rn80/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -190
  131. package/android/src/rnlegacy/java/com/ft/sdk/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.java +0 -120
  132. package/ios/.idea/.name +0 -1
  133. package/ios/.idea/ios.iml +0 -2
  134. package/ios/.idea/modules.xml +0 -8
  135. package/ios/.idea/vcs.xml +0 -6
  136. package/ios/.idea/xcode.xml +0 -4
  137. package/ios/FTMobileReactNative.m +0 -184
  138. package/ios/FTRCTTextViewRecorder.h +0 -33
  139. package/ios/FTRCTTextViewRecorder.m +0 -120
  140. package/ios/FTReactNativeLog.m +0 -60
  141. package/ios/FTReactNativeSessionReplay.h +0 -6
  142. package/ios/FTReactNativeSessionReplay.mm +0 -44
  143. package/ios/FTReactNativeTrace.m +0 -56
  144. package/ios/FtMobileAgent.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  145. package/ios/FtMobileAgent.xcodeproj/project.xcworkspace/xcuserdata/Brandon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  146. package/ios/FtMobileAgent.xcodeproj/project.xcworkspace/xcuserdata/Brandon.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  147. package/ios/FtMobileAgent.xcodeproj/xcuserdata/Brandon.xcuserdatad/xcschemes/FtMobileAgent.xcscheme +0 -56
  148. package/ios/FtMobileAgent.xcodeproj/xcuserdata/Brandon.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  149. package/ios/RCTVersion.h +0 -8
  150. package/lib/commonjs/ft_session_replay.js +0 -34
  151. package/lib/commonjs/ft_session_replay.js.map +0 -1
  152. package/lib/module/ft_session_replay.js +0 -29
  153. package/lib/module/ft_session_replay.js.map +0 -1
  154. package/lib/typescript/ft_session_replay.d.ts +0 -27
  155. package/src/ft_session_replay.tsx +0 -34
@@ -1,120 +0,0 @@
1
- //
2
- // FTRCTTextViewRecorder.m
3
- // FTMobileReactNativeSDK
4
- //
5
- // Created by hulilei on 2024/9/25.
6
- //
7
-
8
- #import "FTRCTTextViewRecorder.h"
9
- #import <React/RCTUIManagerUtils.h>
10
- #import <React/RCTTextView.h>
11
- #import <React/RCTShadowView.h>
12
- #import <React/RCTRawTextShadowView.h>
13
- #import <React/RCTTextShadowView.h>
14
- #import <React/RCTVirtualTextShadowView.h>
15
- #import <FTMobileSDK/FTSRWireframe.h>
16
- #import <FTMobileSDK/FTViewAttributes.h>
17
- #import <FTMobileSDK/FTSRUtils.h>
18
- #import <FTMobileSDK/FTSystemColors.h>
19
- #import <FTMobileSDK/FTViewTreeRecordingContext.h>
20
- #import <FTMobileSDK/FTSRUtils.h>
21
- #import <React/RCTShadowView+Layout.h>
22
- @interface FTRCTTextViewRecorder ()
23
- @property (nonatomic, strong) RCTUIManager *uiManager;
24
- @end
25
- @implementation FTRCTTextViewRecorder
26
- -(instancetype)initWithUIManager:(RCTUIManager *)uiManager{
27
- self = [super init];
28
- if(self){
29
- _identifier = [[NSUUID UUID] UUIDString];
30
- _uiManager = uiManager;
31
- _textObfuscator = ^id<FTSRTextObfuscatingProtocol> _Nullable(FTViewTreeRecordingContext * _Nonnull context,FTViewAttributes *attributes) {
32
- return [FTSRTextObfuscatingFactory staticTextObfuscator:[attributes resolveTextAndInputPrivacyLevel:context.recorder]];
33
- };
34
- }
35
- return self;
36
- }
37
- - (FTSRNodeSemantics *)recorder:(nonnull UIView *)view attributes:(nonnull FTViewAttributes *)attributes context:(nonnull FTViewTreeRecordingContext *)context {
38
- if(![view isKindOfClass:[RCTTextView class]]){
39
- return nil;
40
- }
41
- RCTTextView *textView = (RCTTextView *)view;
42
- NSNumber *tag = textView.reactTag;
43
-
44
- __block RCTShadowView *shadowView = nil;
45
- dispatch_queue_t queue = RCTGetUIManagerQueue();
46
- dispatch_sync(queue, ^{
47
- shadowView = [self.uiManager shadowViewForReactTag:tag];
48
- });
49
-
50
- if([shadowView isKindOfClass:[RCTTextShadowView class]]){
51
- RCTTextShadowView *shadow = (RCTTextShadowView *)shadowView;
52
- NSString *text = [self extractTextFromSubViews:[shadowView reactSubviews]];
53
- FTRCTTextViewBuilder *builder = [[FTRCTTextViewBuilder alloc]init];
54
- builder.wireframeID = [context.viewIDGenerator SRViewID:textView nodeRecorder:self];
55
- builder.attributes = attributes;
56
- builder.text = text;
57
- builder.textAlignment = shadow.textAttributes.alignment;
58
- builder.textColor = shadow.textAttributes.foregroundColor?shadow.textAttributes.foregroundColor:[UIColor blackColor];
59
- builder.textObfuscator = self.textObfuscator(context,attributes);
60
- builder.fontSize = shadow.textAttributes.fontSize;
61
- builder.wireframeRect = attributes.frame;
62
- builder.contentRect = shadow.contentFrame;
63
-
64
- FTSpecificElement *element = [[FTSpecificElement alloc]initWithSubtreeStrategy:NodeSubtreeStrategyIgnore];
65
- element.nodes = @[builder];
66
- return element;
67
- }
68
- return [FTInvisibleElement constant];
69
- }
70
- - (NSString *)extractTextFromSubViews:(NSArray<RCTShadowView *>*)subViews{
71
- if(subViews && subViews.count>0){
72
- NSString *result = @"";
73
- for (id view in subViews) {
74
- if ([view isKindOfClass:[RCTRawTextShadowView class]]){
75
- RCTRawTextShadowView *textView = (RCTRawTextShadowView *)view;
76
- if (textView.text) {
77
- result = [result stringByAppendingString:textView.text];
78
- }
79
- }
80
- if ([view isKindOfClass:[RCTVirtualTextShadowView class]]){
81
- NSString *str = [self extractTextFromSubViews:[view reactSubviews]];
82
- if (str) {
83
- result = [result stringByAppendingString:str];
84
- }
85
- }
86
- }
87
- return result;
88
- }
89
- return nil;
90
- }
91
- @end
92
-
93
- @implementation FTRCTTextViewBuilder
94
- - (nonnull NSArray<FTSRWireframe *> *)buildWireframes {
95
- CGRect frame = [self relativeIntersectedRect];
96
- FTSRTextWireframe *wireframe = [[FTSRTextWireframe alloc]initWithIdentifier:self.wireframeID frame:frame];
97
-
98
- wireframe.text = [self.textObfuscator mask:self.text];
99
- wireframe.border = [[FTSRShapeBorder alloc]initWithColor:[FTSRUtils colorHexString:self.attributes.layerBorderColor] width:self.attributes.layerBorderWidth];
100
- wireframe.shapeStyle = [[FTSRShapeStyle alloc]initWithBackgroundColor:[FTSRUtils colorHexString:self.attributes.backgroundColor.CGColor] cornerRadius:@(self.attributes.layerCornerRadius) opacity:@(self.attributes.alpha)];
101
- wireframe.textStyle = [[FTSRTextStyle alloc]initWithSize:self.fontSize?self.fontSize:14 color:[FTSRUtils colorHexString:self.textColor.CGColor] family:nil];
102
- FTSRTextPosition *textPosition = [[FTSRTextPosition alloc]init];
103
- textPosition.alignment = [[FTAlignment alloc]initWithTextAlignment:self.textAlignment vertical:@"top"];
104
- CGRect textFrame = [self textFrame];
105
- textPosition.padding = [[FTPadding alloc]initWithLeft:CGRectGetMinX(frame)-CGRectGetMinX(textFrame) top:CGRectGetMinY(frame)-CGRectGetMinY(textFrame) right:CGRectGetMaxX(frame)-CGRectGetMaxX(textFrame) bottom:CGRectGetMaxY(frame)-CGRectGetMaxY(textFrame)];
106
- wireframe.textPosition = textPosition;
107
- wireframe.clip = [[FTSRContentClip alloc] initWithFrame:self.wireframeRect clip:self.attributes.clip];;
108
- return @[wireframe];
109
- }
110
-
111
- - (CGRect)relativeIntersectedRect{
112
- return CGRectMake(self.attributes.frame.origin.x, self.attributes.frame.origin.y, MAX(self.contentRect.size.width, self.attributes.frame.size.width), MAX(self.contentRect.size.height, self.attributes.frame.size.height));
113
- }
114
- - (CGRect)textFrame{
115
- return CGRectMake(self.attributes.frame.origin.x+self.contentRect.origin.x, self.attributes.frame.origin.y+self.contentRect.origin.y, self.contentRect.size.width, self.contentRect.size.height);
116
- }
117
- @end
118
-
119
-
120
-
@@ -1,60 +0,0 @@
1
- //
2
- // FTReactNativeLog.m
3
- // FtMobileAgent
4
- //
5
- // Created by Hu Leilei on 2021/12/14.
6
- // Copyright © 2021 Facebook. All rights reserved.
7
- //
8
-
9
- #import "FTReactNativeLog.h"
10
- #import <FTMobileSDK/FTMobileAgent.h>
11
- #import <React/RCTConvert.h>
12
- #import <FTMobileSDK/FTLogger+Private.h>
13
- @implementation FTReactNativeLog
14
- RCT_EXPORT_MODULE()
15
-
16
- RCT_REMAP_METHOD(logConfig,
17
- context:(NSDictionary *)context
18
- findEventsWithResolver:(RCTPromiseResolveBlock)resolve
19
- rejecter:(RCTPromiseRejectBlock)reject){
20
- FTLoggerConfig *logger = [[FTLoggerConfig alloc]init];
21
- if ([context.allKeys containsObject:@"sampleRate"]) {
22
- logger.samplerate = [RCTConvert double:context[@"sampleRate"]]*100;
23
- }
24
- NSArray<NSNumber *>*filters = [RCTConvert NSNumberArray:context[@"logLevelFilters"]];
25
- if (filters) {
26
- logger.logLevelFilter = filters;
27
- }
28
- if([context.allKeys containsObject:@"discardStrategy"]){
29
- logger.discardType = [RCTConvert int:context[@"discardStrategy"]];
30
- }
31
- if ([context.allKeys containsObject:@"globalContext"]) {
32
- logger.globalContext = [RCTConvert NSDictionary:context[@"globalContext"]];
33
- }
34
- logger.enableCustomLog = [RCTConvert BOOL:context[@"enableCustomLog"]];
35
- logger.enableLinkRumData = [RCTConvert BOOL:context[@"enableLinkRumData"]];
36
- if ([context.allKeys containsObject:@"logCacheLimitCount"]) {
37
- logger.logCacheLimitCount = [RCTConvert int:context[@"logCacheLimitCount"]];
38
- }
39
- [[FTMobileAgent sharedInstance] startLoggerWithConfigOptions:logger];
40
- resolve(nil);
41
- }
42
-
43
- RCT_REMAP_METHOD(logging,
44
- logging:(NSString *)content status:(nonnull NSNumber *)status property:(NSDictionary *)property
45
- findEventsWithResolver:(RCTPromiseResolveBlock)resolve
46
- rejecter:(RCTPromiseRejectBlock)reject){
47
-
48
- FTLogStatus logStatus =(FTLogStatus)[status integerValue];
49
- [[FTLogger sharedInstance] log:content statusType:logStatus property:property];
50
- resolve(nil);
51
- }
52
- RCT_REMAP_METHOD(logWithStatusString,
53
- logWithStatusString:(NSString *)content status:(NSString *)status property:(NSDictionary *)property
54
- findEventsWithResolver:(RCTPromiseResolveBlock)resolve
55
- rejecter:(RCTPromiseRejectBlock)reject){
56
- [[FTLogger sharedInstance] log:content status:status property:property];
57
- resolve(nil);
58
- }
59
- @end
60
-
@@ -1,6 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <React/RCTBridgeModule.h>
3
-
4
- @interface FTReactNativeSessionReplay : NSObject <RCTBridgeModule>
5
-
6
- @end
@@ -1,44 +0,0 @@
1
- #import "FTReactNativeSessionReplay.h"
2
- #import <FTMobileSDK/FTRumSessionReplay.h>
3
- #import <FTMobileSDK/FTSessionReplayConfig+Private.h>
4
- #import <React/RCTConvert.h>
5
- #import "FTRCTTextViewRecorder.h"
6
- @implementation FTReactNativeSessionReplay
7
- @synthesize bridge = _bridge;
8
-
9
- RCT_EXPORT_MODULE()
10
-
11
- // Example method
12
- // See // https://reactnative.dev/docs/native-modules-ios
13
- RCT_REMAP_METHOD(sessionReplayConfig,
14
- context:(NSDictionary *)context
15
- resolve:(RCTPromiseResolveBlock)resolve
16
- reject:(RCTPromiseRejectBlock)reject)
17
- {
18
- FTSessionReplayConfig *config = [[FTSessionReplayConfig alloc]init];
19
- if([context.allKeys containsObject:@"sampleRate"]){
20
- config.sampleRate = [RCTConvert double:context[@"sampleRate"]]*100;
21
- }
22
- if([context.allKeys containsObject:@"privacy"]){
23
- int privacy = [context[@"privacy"] intValue];
24
- switch (privacy){
25
- case 0:
26
- config.privacy = FTSRPrivacyMask;
27
- break;
28
- case 1:
29
- config.privacy = FTSRPrivacyAllow;
30
- break;
31
- case 2:
32
- config.privacy = FTSRPrivacyMaskUserInput;
33
- break;
34
- }
35
- }
36
- FTRCTTextViewRecorder *recorder = [[FTRCTTextViewRecorder alloc]initWithUIManager:_bridge.uiManager];
37
- [config setAdditionalNodeRecorders:@[recorder]];
38
- [[FTRumSessionReplay sharedInstance] startWithSessionReplayConfig:config];
39
- resolve(nil);
40
- }
41
- + (BOOL)requiresMainQueueSetup {
42
- return NO;
43
- }
44
- @end
@@ -1,56 +0,0 @@
1
- //
2
- // FTReactNativeTrace.m
3
- // FtMobileAgent
4
- //
5
- // Created by Hu Leilei on 2021/12/14.
6
- // Copyright © 2021 Facebook. All rights reserved.
7
- //
8
-
9
- #import "FTReactNativeTrace.h"
10
- #import <FTMobileSDK/FTMobileAgent.h>
11
- #import <FTMobileSDK/FTExternalDataManager.h>
12
- #import <FTMobileSDK/FTResourceMetricsModel.h>
13
- #import <FTMobileSDK/FTResourceContentModel.h>
14
- #import <React/RCTConvert.h>
15
- #import <FTMobileSDK/FTTraceManager.h>
16
- @implementation FTReactNativeTrace
17
- RCT_EXPORT_MODULE()
18
-
19
- RCT_REMAP_METHOD(setConfig,
20
- context:(NSDictionary *)context
21
- findEventsWithResolver:(RCTPromiseResolveBlock)resolve
22
- rejecter:(RCTPromiseRejectBlock)reject){
23
- FTTraceConfig *trace = [[FTTraceConfig alloc]init];
24
- if ([context.allKeys containsObject:@"sampleRate"]) {
25
- trace.samplerate =[RCTConvert double:context[@"sampleRate"]] * 100;
26
- }
27
- if ([context.allKeys containsObject:@"traceType"]) {
28
- int traceType = [RCTConvert int:context[@"traceType"]];
29
- trace.networkTraceType = traceType;
30
- }
31
- trace.enableLinkRumData = [RCTConvert BOOL:context[@"enableLinkRUMData"]];
32
- trace.enableAutoTrace = [RCTConvert BOOL:context[@"enableNativeAutoTrace"]];
33
- [[FTMobileAgent sharedInstance] startTraceWithConfigOptions:trace];
34
- resolve(nil);
35
- }
36
-
37
- RCT_REMAP_METHOD(getTraceHeaderFields,
38
- url:(NSString *)url
39
- key:(NSString *)key
40
- findEventsWithResolver:(RCTPromiseResolveBlock)resolve
41
- rejecter:(RCTPromiseRejectBlock)reject){
42
- NSDictionary *traceHeader = nil;
43
- if(key&&key.length>0){
44
- traceHeader = [[FTExternalDataManager sharedManager] getTraceHeaderWithKey:key url:[NSURL URLWithString:url]];
45
- }else{
46
- traceHeader = [[FTExternalDataManager sharedManager] getTraceHeaderWithUrl:[NSURL URLWithString:url]];
47
- }
48
- if (traceHeader) {
49
- resolve(traceHeader);
50
- }else{
51
- resolve(nil);
52
- }
53
- }
54
-
55
- @end
56
-
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- </Workspace>
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict />
5
- </plist>
@@ -1,56 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- version = "1.7">
4
- <BuildAction
5
- parallelizeBuildables = "YES"
6
- buildImplicitDependencies = "YES">
7
- <BuildActionEntries>
8
- <BuildActionEntry
9
- buildForTesting = "YES"
10
- buildForRunning = "YES"
11
- buildForProfiling = "YES"
12
- buildForArchiving = "YES"
13
- buildForAnalyzing = "YES">
14
- <BuildableReference
15
- BuildableIdentifier = "primary"
16
- BlueprintIdentifier = "58B511DA1A9E6C8500147676"
17
- BuildableName = "libFtMobileAgent.a"
18
- BlueprintName = "FtMobileAgent"
19
- ReferencedContainer = "container:FtMobileAgent.xcodeproj">
20
- </BuildableReference>
21
- </BuildActionEntry>
22
- </BuildActionEntries>
23
- </BuildAction>
24
- <TestAction
25
- buildConfiguration = "Debug"
26
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
- shouldUseLaunchSchemeArgsEnv = "YES"
29
- shouldAutocreateTestPlan = "YES">
30
- </TestAction>
31
- <LaunchAction
32
- buildConfiguration = "Debug"
33
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
34
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
35
- launchStyle = "0"
36
- useCustomWorkingDirectory = "NO"
37
- ignoresPersistentStateOnLaunch = "NO"
38
- debugDocumentVersioning = "YES"
39
- debugServiceExtension = "internal"
40
- allowLocationSimulation = "YES">
41
- </LaunchAction>
42
- <ProfileAction
43
- buildConfiguration = "Release"
44
- shouldUseLaunchSchemeArgsEnv = "YES"
45
- savedToolIdentifier = ""
46
- useCustomWorkingDirectory = "NO"
47
- debugDocumentVersioning = "YES">
48
- </ProfileAction>
49
- <AnalyzeAction
50
- buildConfiguration = "Debug">
51
- </AnalyzeAction>
52
- <ArchiveAction
53
- buildConfiguration = "Release"
54
- revealArchiveInOrganizer = "YES">
55
- </ArchiveAction>
56
- </Scheme>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>FtMobileAgent.xcscheme</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>0</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>
package/ios/RCTVersion.h DELETED
@@ -1,8 +0,0 @@
1
- #ifndef RCTVersion_h
2
- #define RCTVersion_h
3
-
4
- #define RCT_VERSION_MAJOR 0
5
- #define RCT_VERSION_MINOR 70
6
- #define RCT_VERSION_PATCH 0
7
-
8
- #endif /* RCTVersion_h */
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SessionReplayPrivacy = exports.FTReactNativeSessionReplay = void 0;
7
- var _reactNative = require("react-native");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- /**
12
- * Privacy level for content masking in session replay.
13
- */
14
- let SessionReplayPrivacy = exports.SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
15
- SessionReplayPrivacy[SessionReplayPrivacy["MASK"] = 0] = "MASK";
16
- SessionReplayPrivacy[SessionReplayPrivacy["ALLOW"] = 1] = "ALLOW";
17
- SessionReplayPrivacy[SessionReplayPrivacy["MASK_USER_INPUT"] = 2] = "MASK_USER_INPUT";
18
- return SessionReplayPrivacy;
19
- }({});
20
- /**
21
- * Set Session Replay configuration.
22
- * @param sampleRate Sampling rate
23
- * @param privacy Privacy level for content masking in session replay
24
- */
25
- class FTReactNativeSessionReplayWrapper {
26
- constructor() {
27
- _defineProperty(this, "sessionReplay", _reactNative.NativeModules.FTReactNativeSessionReplay);
28
- }
29
- sessionReplayConfig(config) {
30
- return this.sessionReplay.sessionReplayConfig(config);
31
- }
32
- }
33
- const FTReactNativeSessionReplay = exports.FTReactNativeSessionReplay = new FTReactNativeSessionReplayWrapper();
34
- //# sourceMappingURL=ft_session_replay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SessionReplayPrivacy","exports","FTReactNativeSessionReplayWrapper","constructor","NativeModules","FTReactNativeSessionReplay","sessionReplayConfig","config","sessionReplay"],"sources":["ft_session_replay.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n/**\n * Privacy level for content masking in session replay.\n */\nexport enum SessionReplayPrivacy {\n MASK ,\n ALLOW ,\n MASK_USER_INPUT\n}\n/**\n * Set Session Replay configuration.\n * @param sampleRate Sampling rate\n * @param privacy Privacy level for content masking in session replay\n */\nexport interface FTSessionReplayConfig{\n sampleRate?:number,\n privacy?:SessionReplayPrivacy\n }\ntype FTReactNativeSessionReplayType = {\n /**\n * Set Session Replay configuration and enable session replay\n * @param config Session Replay configuration parameters.\n * @returns a Promise.\n */\n sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>;\n}\n\nclass FTReactNativeSessionReplayWrapper implements FTReactNativeSessionReplayType {\n private sessionReplay: FTReactNativeSessionReplayType = NativeModules.FTReactNativeSessionReplay;\n sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>{\n return this.sessionReplay.sessionReplayConfig(config);\n }\n}\nexport const FTReactNativeSessionReplay: FTReactNativeSessionReplayType = new FTReactNativeSessionReplayWrapper();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAA6C,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAC7C;AACA;AACA;AAFA,IAGYgB,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAKhC;AACA;AACA;AACA;AACA;AAcA,MAAME,iCAAiC,CAA2C;EAAAC,YAAA;IAAAtB,eAAA,wBACtBuB,0BAAa,CAACC,0BAA0B;EAAA;EAChGC,mBAAmBA,CAACC,MAA4B,EAAgB;IAC5D,OAAO,IAAI,CAACC,aAAa,CAACF,mBAAmB,CAACC,MAAM,CAAC;EACzD;AACJ;AACO,MAAMF,0BAA0D,GAAAJ,OAAA,CAAAI,0BAAA,GAAG,IAAIH,iCAAiC,CAAC,CAAC","ignoreList":[]}
@@ -1,29 +0,0 @@
1
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { NativeModules } from 'react-native';
5
- /**
6
- * Privacy level for content masking in session replay.
7
- */
8
- export let SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
9
- SessionReplayPrivacy[SessionReplayPrivacy["MASK"] = 0] = "MASK";
10
- SessionReplayPrivacy[SessionReplayPrivacy["ALLOW"] = 1] = "ALLOW";
11
- SessionReplayPrivacy[SessionReplayPrivacy["MASK_USER_INPUT"] = 2] = "MASK_USER_INPUT";
12
- return SessionReplayPrivacy;
13
- }({});
14
- /**
15
- * Set Session Replay configuration.
16
- * @param sampleRate Sampling rate
17
- * @param privacy Privacy level for content masking in session replay
18
- */
19
-
20
- class FTReactNativeSessionReplayWrapper {
21
- constructor() {
22
- _defineProperty(this, "sessionReplay", NativeModules.FTReactNativeSessionReplay);
23
- }
24
- sessionReplayConfig(config) {
25
- return this.sessionReplay.sessionReplayConfig(config);
26
- }
27
- }
28
- export const FTReactNativeSessionReplay = new FTReactNativeSessionReplayWrapper();
29
- //# sourceMappingURL=ft_session_replay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeModules","SessionReplayPrivacy","FTReactNativeSessionReplayWrapper","constructor","_defineProperty","FTReactNativeSessionReplay","sessionReplayConfig","config","sessionReplay"],"sources":["ft_session_replay.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n/**\n * Privacy level for content masking in session replay.\n */\nexport enum SessionReplayPrivacy {\n MASK ,\n ALLOW ,\n MASK_USER_INPUT\n}\n/**\n * Set Session Replay configuration.\n * @param sampleRate Sampling rate\n * @param privacy Privacy level for content masking in session replay\n */\nexport interface FTSessionReplayConfig{\n sampleRate?:number,\n privacy?:SessionReplayPrivacy\n }\ntype FTReactNativeSessionReplayType = {\n /**\n * Set Session Replay configuration and enable session replay\n * @param config Session Replay configuration parameters.\n * @returns a Promise.\n */\n sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>;\n}\n\nclass FTReactNativeSessionReplayWrapper implements FTReactNativeSessionReplayType {\n private sessionReplay: FTReactNativeSessionReplayType = NativeModules.FTReactNativeSessionReplay;\n sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>{\n return this.sessionReplay.sessionReplayConfig(config);\n }\n}\nexport const FTReactNativeSessionReplay: FTReactNativeSessionReplayType = new FTReactNativeSessionReplayWrapper();\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C;AACA;AACA;AACA,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAKhC;AACA;AACA;AACA;AACA;;AAcA,MAAMC,iCAAiC,CAA2C;EAAAC,YAAA;IAAAC,eAAA,wBACtBJ,aAAa,CAACK,0BAA0B;EAAA;EAChGC,mBAAmBA,CAACC,MAA4B,EAAgB;IAC5D,OAAO,IAAI,CAACC,aAAa,CAACF,mBAAmB,CAACC,MAAM,CAAC;EACzD;AACJ;AACA,OAAO,MAAMF,0BAA0D,GAAG,IAAIH,iCAAiC,CAAC,CAAC","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- /**
2
- * Privacy level for content masking in session replay.
3
- */
4
- export declare enum SessionReplayPrivacy {
5
- MASK = 0,
6
- ALLOW = 1,
7
- MASK_USER_INPUT = 2
8
- }
9
- /**
10
- * Set Session Replay configuration.
11
- * @param sampleRate Sampling rate
12
- * @param privacy Privacy level for content masking in session replay
13
- */
14
- export interface FTSessionReplayConfig {
15
- sampleRate?: number;
16
- privacy?: SessionReplayPrivacy;
17
- }
18
- type FTReactNativeSessionReplayType = {
19
- /**
20
- * Set Session Replay configuration and enable session replay
21
- * @param config Session Replay configuration parameters.
22
- * @returns a Promise.
23
- */
24
- sessionReplayConfig(config: FTSessionReplayConfig): Promise<void>;
25
- };
26
- export declare const FTReactNativeSessionReplay: FTReactNativeSessionReplayType;
27
- export {};
@@ -1,34 +0,0 @@
1
- import { NativeModules } from 'react-native';
2
- /**
3
- * Privacy level for content masking in session replay.
4
- */
5
- export enum SessionReplayPrivacy {
6
- MASK ,
7
- ALLOW ,
8
- MASK_USER_INPUT
9
- }
10
- /**
11
- * Set Session Replay configuration.
12
- * @param sampleRate Sampling rate
13
- * @param privacy Privacy level for content masking in session replay
14
- */
15
- export interface FTSessionReplayConfig{
16
- sampleRate?:number,
17
- privacy?:SessionReplayPrivacy
18
- }
19
- type FTReactNativeSessionReplayType = {
20
- /**
21
- * Set Session Replay configuration and enable session replay
22
- * @param config Session Replay configuration parameters.
23
- * @returns a Promise.
24
- */
25
- sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>;
26
- }
27
-
28
- class FTReactNativeSessionReplayWrapper implements FTReactNativeSessionReplayType {
29
- private sessionReplay: FTReactNativeSessionReplayType = NativeModules.FTReactNativeSessionReplay;
30
- sessionReplayConfig(config:FTSessionReplayConfig): Promise<void>{
31
- return this.sessionReplay.sessionReplayConfig(config);
32
- }
33
- }
34
- export const FTReactNativeSessionReplay: FTReactNativeSessionReplayType = new FTReactNativeSessionReplayWrapper();