@rejourneyco/react-native 1.0.0

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 (152) hide show
  1. package/android/build.gradle.kts +135 -0
  2. package/android/consumer-rules.pro +10 -0
  3. package/android/proguard-rules.pro +1 -0
  4. package/android/src/main/AndroidManifest.xml +15 -0
  5. package/android/src/main/java/com/rejourney/RejourneyModuleImpl.kt +2981 -0
  6. package/android/src/main/java/com/rejourney/capture/ANRHandler.kt +206 -0
  7. package/android/src/main/java/com/rejourney/capture/ActivityTracker.kt +98 -0
  8. package/android/src/main/java/com/rejourney/capture/CaptureEngine.kt +1553 -0
  9. package/android/src/main/java/com/rejourney/capture/CaptureHeuristics.kt +375 -0
  10. package/android/src/main/java/com/rejourney/capture/CrashHandler.kt +153 -0
  11. package/android/src/main/java/com/rejourney/capture/MotionEvent.kt +215 -0
  12. package/android/src/main/java/com/rejourney/capture/SegmentUploader.kt +512 -0
  13. package/android/src/main/java/com/rejourney/capture/VideoEncoder.kt +773 -0
  14. package/android/src/main/java/com/rejourney/capture/ViewHierarchyScanner.kt +633 -0
  15. package/android/src/main/java/com/rejourney/capture/ViewSerializer.kt +286 -0
  16. package/android/src/main/java/com/rejourney/core/Constants.kt +117 -0
  17. package/android/src/main/java/com/rejourney/core/Logger.kt +93 -0
  18. package/android/src/main/java/com/rejourney/core/Types.kt +124 -0
  19. package/android/src/main/java/com/rejourney/lifecycle/SessionLifecycleService.kt +162 -0
  20. package/android/src/main/java/com/rejourney/network/DeviceAuthManager.kt +747 -0
  21. package/android/src/main/java/com/rejourney/network/HttpClientProvider.kt +16 -0
  22. package/android/src/main/java/com/rejourney/network/NetworkMonitor.kt +272 -0
  23. package/android/src/main/java/com/rejourney/network/UploadManager.kt +1363 -0
  24. package/android/src/main/java/com/rejourney/network/UploadWorker.kt +492 -0
  25. package/android/src/main/java/com/rejourney/privacy/PrivacyMask.kt +645 -0
  26. package/android/src/main/java/com/rejourney/touch/GestureClassifier.kt +233 -0
  27. package/android/src/main/java/com/rejourney/touch/KeyboardTracker.kt +158 -0
  28. package/android/src/main/java/com/rejourney/touch/TextInputTracker.kt +181 -0
  29. package/android/src/main/java/com/rejourney/touch/TouchInterceptor.kt +591 -0
  30. package/android/src/main/java/com/rejourney/utils/EventBuffer.kt +284 -0
  31. package/android/src/main/java/com/rejourney/utils/OEMDetector.kt +154 -0
  32. package/android/src/main/java/com/rejourney/utils/PerfTiming.kt +235 -0
  33. package/android/src/main/java/com/rejourney/utils/Telemetry.kt +297 -0
  34. package/android/src/main/java/com/rejourney/utils/WindowUtils.kt +84 -0
  35. package/android/src/newarch/java/com/rejourney/RejourneyModule.kt +187 -0
  36. package/android/src/newarch/java/com/rejourney/RejourneyPackage.kt +40 -0
  37. package/android/src/oldarch/java/com/rejourney/RejourneyModule.kt +218 -0
  38. package/android/src/oldarch/java/com/rejourney/RejourneyPackage.kt +23 -0
  39. package/ios/Capture/RJANRHandler.h +42 -0
  40. package/ios/Capture/RJANRHandler.m +328 -0
  41. package/ios/Capture/RJCaptureEngine.h +275 -0
  42. package/ios/Capture/RJCaptureEngine.m +2062 -0
  43. package/ios/Capture/RJCaptureHeuristics.h +80 -0
  44. package/ios/Capture/RJCaptureHeuristics.m +903 -0
  45. package/ios/Capture/RJCrashHandler.h +46 -0
  46. package/ios/Capture/RJCrashHandler.m +313 -0
  47. package/ios/Capture/RJMotionEvent.h +183 -0
  48. package/ios/Capture/RJMotionEvent.m +183 -0
  49. package/ios/Capture/RJPerformanceManager.h +100 -0
  50. package/ios/Capture/RJPerformanceManager.m +373 -0
  51. package/ios/Capture/RJPixelBufferDownscaler.h +42 -0
  52. package/ios/Capture/RJPixelBufferDownscaler.m +85 -0
  53. package/ios/Capture/RJSegmentUploader.h +146 -0
  54. package/ios/Capture/RJSegmentUploader.m +778 -0
  55. package/ios/Capture/RJVideoEncoder.h +247 -0
  56. package/ios/Capture/RJVideoEncoder.m +1036 -0
  57. package/ios/Capture/RJViewControllerTracker.h +73 -0
  58. package/ios/Capture/RJViewControllerTracker.m +508 -0
  59. package/ios/Capture/RJViewHierarchyScanner.h +215 -0
  60. package/ios/Capture/RJViewHierarchyScanner.m +1464 -0
  61. package/ios/Capture/RJViewSerializer.h +119 -0
  62. package/ios/Capture/RJViewSerializer.m +498 -0
  63. package/ios/Core/RJConstants.h +124 -0
  64. package/ios/Core/RJConstants.m +88 -0
  65. package/ios/Core/RJLifecycleManager.h +85 -0
  66. package/ios/Core/RJLifecycleManager.m +308 -0
  67. package/ios/Core/RJLogger.h +61 -0
  68. package/ios/Core/RJLogger.m +211 -0
  69. package/ios/Core/RJTypes.h +176 -0
  70. package/ios/Core/RJTypes.m +66 -0
  71. package/ios/Core/Rejourney.h +64 -0
  72. package/ios/Core/Rejourney.mm +2495 -0
  73. package/ios/Network/RJDeviceAuthManager.h +94 -0
  74. package/ios/Network/RJDeviceAuthManager.m +967 -0
  75. package/ios/Network/RJNetworkMonitor.h +68 -0
  76. package/ios/Network/RJNetworkMonitor.m +267 -0
  77. package/ios/Network/RJRetryManager.h +73 -0
  78. package/ios/Network/RJRetryManager.m +325 -0
  79. package/ios/Network/RJUploadManager.h +267 -0
  80. package/ios/Network/RJUploadManager.m +2296 -0
  81. package/ios/Privacy/RJPrivacyMask.h +163 -0
  82. package/ios/Privacy/RJPrivacyMask.m +922 -0
  83. package/ios/Rejourney.h +63 -0
  84. package/ios/Touch/RJGestureClassifier.h +130 -0
  85. package/ios/Touch/RJGestureClassifier.m +333 -0
  86. package/ios/Touch/RJTouchInterceptor.h +169 -0
  87. package/ios/Touch/RJTouchInterceptor.m +772 -0
  88. package/ios/Utils/RJEventBuffer.h +112 -0
  89. package/ios/Utils/RJEventBuffer.m +358 -0
  90. package/ios/Utils/RJGzipUtils.h +33 -0
  91. package/ios/Utils/RJGzipUtils.m +89 -0
  92. package/ios/Utils/RJKeychainManager.h +48 -0
  93. package/ios/Utils/RJKeychainManager.m +111 -0
  94. package/ios/Utils/RJPerfTiming.h +209 -0
  95. package/ios/Utils/RJPerfTiming.m +264 -0
  96. package/ios/Utils/RJTelemetry.h +92 -0
  97. package/ios/Utils/RJTelemetry.m +320 -0
  98. package/ios/Utils/RJWindowUtils.h +66 -0
  99. package/ios/Utils/RJWindowUtils.m +133 -0
  100. package/lib/commonjs/NativeRejourney.js +40 -0
  101. package/lib/commonjs/components/Mask.js +79 -0
  102. package/lib/commonjs/index.js +1381 -0
  103. package/lib/commonjs/sdk/autoTracking.js +1259 -0
  104. package/lib/commonjs/sdk/constants.js +151 -0
  105. package/lib/commonjs/sdk/errorTracking.js +199 -0
  106. package/lib/commonjs/sdk/index.js +50 -0
  107. package/lib/commonjs/sdk/metricsTracking.js +204 -0
  108. package/lib/commonjs/sdk/navigation.js +151 -0
  109. package/lib/commonjs/sdk/networkInterceptor.js +412 -0
  110. package/lib/commonjs/sdk/utils.js +363 -0
  111. package/lib/commonjs/types/expo-router.d.js +2 -0
  112. package/lib/commonjs/types/index.js +2 -0
  113. package/lib/module/NativeRejourney.js +38 -0
  114. package/lib/module/components/Mask.js +72 -0
  115. package/lib/module/index.js +1284 -0
  116. package/lib/module/sdk/autoTracking.js +1233 -0
  117. package/lib/module/sdk/constants.js +145 -0
  118. package/lib/module/sdk/errorTracking.js +189 -0
  119. package/lib/module/sdk/index.js +12 -0
  120. package/lib/module/sdk/metricsTracking.js +187 -0
  121. package/lib/module/sdk/navigation.js +143 -0
  122. package/lib/module/sdk/networkInterceptor.js +401 -0
  123. package/lib/module/sdk/utils.js +342 -0
  124. package/lib/module/types/expo-router.d.js +2 -0
  125. package/lib/module/types/index.js +2 -0
  126. package/lib/typescript/NativeRejourney.d.ts +147 -0
  127. package/lib/typescript/components/Mask.d.ts +39 -0
  128. package/lib/typescript/index.d.ts +117 -0
  129. package/lib/typescript/sdk/autoTracking.d.ts +204 -0
  130. package/lib/typescript/sdk/constants.d.ts +120 -0
  131. package/lib/typescript/sdk/errorTracking.d.ts +32 -0
  132. package/lib/typescript/sdk/index.d.ts +9 -0
  133. package/lib/typescript/sdk/metricsTracking.d.ts +58 -0
  134. package/lib/typescript/sdk/navigation.d.ts +33 -0
  135. package/lib/typescript/sdk/networkInterceptor.d.ts +47 -0
  136. package/lib/typescript/sdk/utils.d.ts +148 -0
  137. package/lib/typescript/types/index.d.ts +624 -0
  138. package/package.json +102 -0
  139. package/rejourney.podspec +21 -0
  140. package/src/NativeRejourney.ts +165 -0
  141. package/src/components/Mask.tsx +80 -0
  142. package/src/index.ts +1459 -0
  143. package/src/sdk/autoTracking.ts +1373 -0
  144. package/src/sdk/constants.ts +134 -0
  145. package/src/sdk/errorTracking.ts +231 -0
  146. package/src/sdk/index.ts +11 -0
  147. package/src/sdk/metricsTracking.ts +232 -0
  148. package/src/sdk/navigation.ts +157 -0
  149. package/src/sdk/networkInterceptor.ts +440 -0
  150. package/src/sdk/utils.ts +369 -0
  151. package/src/types/expo-router.d.ts +7 -0
  152. package/src/types/index.ts +739 -0
@@ -0,0 +1,211 @@
1
+ //
2
+ // RJLogger.m
3
+ // Rejourney
4
+ //
5
+ // Centralized logging utility implementation.
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+ // Copyright (c) 2026 Rejourney
20
+ //
21
+
22
+ #import "RJLogger.h"
23
+
24
+ #if __has_include(<React/RCTLog.h>)
25
+ #import <React/RCTLog.h>
26
+ #define RJ_HAS_RCT_LOG 1
27
+ #else
28
+ #define RJ_HAS_RCT_LOG 0
29
+ #endif
30
+
31
+ static RJLogLevel _minimumLogLevel;
32
+ static BOOL _includeTimestamps = NO;
33
+ static BOOL _debugMode = NO;
34
+ static dispatch_once_t _onceToken;
35
+
36
+ static NSString *const kLogPrefix = @"[Rejourney]";
37
+
38
+ @implementation RJLogger
39
+
40
+ #pragma mark - Class Properties
41
+
42
+ + (void)initialize {
43
+ if (self == [RJLogger class]) {
44
+ dispatch_once(&_onceToken, ^{
45
+ _minimumLogLevel = RJLogLevelSilent;
46
+ _debugMode = NO;
47
+ });
48
+ }
49
+ }
50
+
51
+ + (RJLogLevel)minimumLogLevel {
52
+ return _minimumLogLevel;
53
+ }
54
+
55
+ + (void)setMinimumLogLevel:(RJLogLevel)minimumLogLevel {
56
+ _minimumLogLevel = minimumLogLevel;
57
+ }
58
+
59
+ + (BOOL)includeTimestamps {
60
+ return _includeTimestamps;
61
+ }
62
+
63
+ + (void)setIncludeTimestamps:(BOOL)includeTimestamps {
64
+ _includeTimestamps = includeTimestamps;
65
+ }
66
+
67
+ + (BOOL)debugMode {
68
+ return _debugMode;
69
+ }
70
+
71
+ + (void)setDebugMode:(BOOL)enabled {
72
+ _debugMode = enabled;
73
+ if (enabled) {
74
+ _minimumLogLevel = RJLogLevelDebug;
75
+ } else {
76
+ #ifdef DEBUG
77
+ _minimumLogLevel = RJLogLevelError;
78
+ #else
79
+ _minimumLogLevel = RJLogLevelSilent;
80
+ #endif
81
+ }
82
+ }
83
+
84
+ #pragma mark - Logging Methods
85
+
86
+ + (void)debug:(NSString *)format, ... {
87
+ va_list args;
88
+ va_start(args, format);
89
+ [self logWithLevel:RJLogLevelDebug format:format arguments:args];
90
+ va_end(args);
91
+ }
92
+
93
+ + (void)info:(NSString *)format, ... {
94
+ va_list args;
95
+ va_start(args, format);
96
+ [self logWithLevel:RJLogLevelInfo format:format arguments:args];
97
+ va_end(args);
98
+ }
99
+
100
+ + (void)warning:(NSString *)format, ... {
101
+ va_list args;
102
+ va_start(args, format);
103
+ [self logWithLevel:RJLogLevelWarning format:format arguments:args];
104
+ va_end(args);
105
+ }
106
+
107
+ + (void)error:(NSString *)format, ... {
108
+ va_list args;
109
+ va_start(args, format);
110
+ [self logWithLevel:RJLogLevelError format:format arguments:args];
111
+ va_end(args);
112
+ }
113
+
114
+ + (void)logWithLevel:(RJLogLevel)level format:(NSString *)format, ... {
115
+ va_list args;
116
+ va_start(args, format);
117
+ [self logWithLevel:level format:format arguments:args];
118
+ va_end(args);
119
+ }
120
+
121
+ #pragma mark - Private Methods
122
+
123
+ + (void)logWithLevel:(RJLogLevel)level
124
+ format:(NSString *)format
125
+ arguments:(va_list)args {
126
+
127
+ if (level < _minimumLogLevel) {
128
+ return;
129
+ }
130
+
131
+ NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
132
+
133
+ NSMutableString *fullMessage = [NSMutableString string];
134
+
135
+ if (_includeTimestamps) {
136
+ NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
137
+ formatter.dateFormat = @"HH:mm:ss.SSS";
138
+ [fullMessage
139
+ appendFormat:@"[%@] ", [formatter stringFromDate:[NSDate date]]];
140
+ }
141
+
142
+ [fullMessage appendString:kLogPrefix];
143
+ [fullMessage appendString:[self levelIndicator:level]];
144
+ [fullMessage appendString:@" "];
145
+ [fullMessage appendString:message];
146
+
147
+ [self outputLog:fullMessage level:level];
148
+ }
149
+
150
+ + (NSString *)levelIndicator:(RJLogLevel)level {
151
+ switch (level) {
152
+ case RJLogLevelDebug:
153
+ return @"[DEBUG]";
154
+ case RJLogLevelInfo:
155
+ return @"";
156
+ case RJLogLevelWarning:
157
+ return @"[WARN]";
158
+ case RJLogLevelError:
159
+ return @"[ERROR]";
160
+ case RJLogLevelSilent:
161
+ return @"";
162
+ }
163
+ }
164
+
165
+ + (void)outputLog:(NSString *)message level:(RJLogLevel)level {
166
+ #if RJ_HAS_RCT_LOG
167
+
168
+ switch (level) {
169
+ case RJLogLevelDebug:
170
+ case RJLogLevelInfo:
171
+ RCTLogInfo(@"%@", message);
172
+ break;
173
+ case RJLogLevelWarning:
174
+ RCTLogWarn(@"%@", message);
175
+ break;
176
+ case RJLogLevelError:
177
+ RCTLogError(@"%@", message);
178
+ break;
179
+ case RJLogLevelSilent:
180
+ break;
181
+ }
182
+ #else
183
+ NSLog(@"%@", message);
184
+ #endif
185
+ }
186
+
187
+ #pragma mark - Lifecycle Logs
188
+
189
+ + (void)logInitSuccess:(NSString *)version {
190
+ if (_debugMode) {
191
+ RJLogInfo(@"[Rejourney] ✓ SDK initialized (v%@)", version);
192
+ }
193
+ }
194
+
195
+ + (void)logInitFailure:(NSString *)reason {
196
+ RJLogInfo(@"[Rejourney] ✗ Initialization failed: %@", reason);
197
+ }
198
+
199
+ + (void)logSessionStart:(NSString *)sessionId {
200
+ if (_debugMode) {
201
+ RJLogInfo(@"[Rejourney] Session started: %@", sessionId);
202
+ }
203
+ }
204
+
205
+ + (void)logSessionEnd:(NSString *)sessionId {
206
+ if (_debugMode) {
207
+ RJLogInfo(@"[Rejourney] Session ended: %@", sessionId);
208
+ }
209
+ }
210
+
211
+ @end
@@ -0,0 +1,176 @@
1
+ //
2
+ // RJTypes.h
3
+ // Rejourney
4
+ //
5
+ // Common type definitions used throughout the SDK.
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+ // Copyright (c) 2026 Rejourney
20
+ //
21
+
22
+ #import <Foundation/Foundation.h>
23
+
24
+ NS_ASSUME_NONNULL_BEGIN
25
+
26
+ #pragma mark - Capture Importance
27
+
28
+ /**
29
+ * Represents the importance level of a capture event.
30
+ * Higher importance events are less likely to be skipped during throttling.
31
+ */
32
+ typedef NS_ENUM(NSInteger, RJCaptureImportance) {
33
+ /// Low importance - can be freely skipped (e.g., heartbeat)
34
+ RJCaptureImportanceLow = 0,
35
+
36
+ /// Medium importance - skip only under heavy load (e.g., tap gestures)
37
+ RJCaptureImportanceMedium = 1,
38
+
39
+ /// High importance - rarely skip (e.g., scroll events)
40
+ RJCaptureImportanceHigh = 2,
41
+
42
+ /// Critical importance - never skip (e.g., navigation, app lifecycle)
43
+ RJCaptureImportanceCritical = 3
44
+ };
45
+
46
+ #pragma mark - Performance Level
47
+
48
+ /**
49
+ * Represents the current performance level of the capture engine.
50
+ * The engine adjusts its behavior based on system conditions.
51
+ */
52
+ typedef NS_ENUM(NSInteger, RJPerformanceLevel) {
53
+ /// Normal operation - full capture rate
54
+ RJPerformanceLevelNormal = 0,
55
+
56
+ /// Reduced rate due to low battery or thermal throttling
57
+ RJPerformanceLevelReduced = 1,
58
+
59
+ /// Minimal captures due to memory pressure
60
+ RJPerformanceLevelMinimal = 2,
61
+
62
+ /// All non-critical captures paused
63
+ RJPerformanceLevelPaused = 3
64
+ };
65
+
66
+ #pragma mark - Gesture Types
67
+
68
+ /**
69
+ * Represents recognized gesture types.
70
+ */
71
+ typedef NSString *RJGestureType NS_TYPED_EXTENSIBLE_ENUM;
72
+
73
+ /// Single tap gesture
74
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeTap;
75
+ /// Double tap gesture
76
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeDoubleTap;
77
+ /// Long press gesture
78
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeLongPress;
79
+ /// Force touch (3D Touch) gesture
80
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeForceTouch;
81
+ /// Swipe left gesture
82
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeSwipeLeft;
83
+ /// Swipe right gesture
84
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeSwipeRight;
85
+ /// Swipe up gesture
86
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeSwipeUp;
87
+ /// Swipe down gesture
88
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeSwipeDown;
89
+ /// Scroll up gesture
90
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeScrollUp;
91
+ /// Scroll down gesture
92
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeScrollDown;
93
+ /// Pinch in (zoom out) gesture
94
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePinchIn;
95
+ /// Pinch out (zoom in) gesture
96
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePinchOut;
97
+ /// Clockwise rotation gesture
98
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeRotateCW;
99
+ /// Counter-clockwise rotation gesture
100
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeRotateCCW;
101
+ /// Two-finger pan up gesture
102
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePanUp;
103
+ /// Two-finger pan down gesture
104
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePanDown;
105
+ /// Two-finger pan left gesture
106
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePanLeft;
107
+ /// Two-finger pan right gesture
108
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypePanRight;
109
+ /// Two-finger tap gesture
110
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeTwoFingerTap;
111
+ /// Three-finger gesture
112
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeThreeFingerGesture;
113
+ /// Multi-touch gesture (4+ fingers)
114
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeMultiTouch;
115
+ /// Keyboard tap (privacy-preserved)
116
+ FOUNDATION_EXTERN RJGestureType const RJGestureTypeKeyboardTap;
117
+
118
+ #pragma mark - Session Event Types
119
+
120
+ /**
121
+ * Represents session event types for logging.
122
+ */
123
+ typedef NSString *RJEventType NS_TYPED_EXTENSIBLE_ENUM;
124
+
125
+ /// Session started
126
+ FOUNDATION_EXTERN RJEventType const RJEventTypeSessionStart;
127
+ /// Session ended
128
+ FOUNDATION_EXTERN RJEventType const RJEventTypeSessionEnd;
129
+ /// Session timed out due to background
130
+ FOUNDATION_EXTERN RJEventType const RJEventTypeSessionTimeout;
131
+ /// Navigation to new screen
132
+ FOUNDATION_EXTERN RJEventType const RJEventTypeNavigation;
133
+ /// User gesture performed
134
+ FOUNDATION_EXTERN RJEventType const RJEventTypeGesture;
135
+ /// Visual change occurred
136
+ FOUNDATION_EXTERN RJEventType const RJEventTypeVisualChange;
137
+ /// Keyboard shown
138
+ FOUNDATION_EXTERN RJEventType const RJEventTypeKeyboardShow;
139
+ /// Keyboard hidden
140
+ FOUNDATION_EXTERN RJEventType const RJEventTypeKeyboardHide;
141
+ /// Keyboard typing summary
142
+ FOUNDATION_EXTERN RJEventType const RJEventTypeKeyboardTyping;
143
+ /// App entered background
144
+ FOUNDATION_EXTERN RJEventType const RJEventTypeAppBackground;
145
+ /// App entered foreground
146
+ FOUNDATION_EXTERN RJEventType const RJEventTypeAppForeground;
147
+ /// App terminated
148
+ FOUNDATION_EXTERN RJEventType const RJEventTypeAppTerminated;
149
+ /// External URL opened
150
+ FOUNDATION_EXTERN RJEventType const RJEventTypeExternalURLOpened;
151
+ /// OAuth flow started
152
+ FOUNDATION_EXTERN RJEventType const RJEventTypeOAuthStarted;
153
+ /// OAuth flow completed
154
+ FOUNDATION_EXTERN RJEventType const RJEventTypeOAuthCompleted;
155
+ /// OAuth returned from external app
156
+ FOUNDATION_EXTERN RJEventType const RJEventTypeOAuthReturned;
157
+
158
+ #pragma mark - Completion Handlers
159
+
160
+ /**
161
+ * Completion handler for operations that may succeed or fail.
162
+ *
163
+ * @param success Whether the operation succeeded.
164
+ */
165
+ typedef void (^RJCompletionHandler)(BOOL success);
166
+
167
+ /**
168
+ * Completion handler for session operations.
169
+ *
170
+ * @param success Whether the operation succeeded.
171
+ * @param sessionId The session ID (if applicable).
172
+ * @param error Error description (if failed).
173
+ */
174
+ typedef void (^RJSessionCompletionHandler)(BOOL success, NSString *_Nullable sessionId, NSString *_Nullable error);
175
+
176
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,66 @@
1
+ //
2
+ // RJTypes.m
3
+ // Rejourney
4
+ //
5
+ // Common type definitions implementation.
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+ // Copyright (c) 2026 Rejourney
20
+ //
21
+
22
+ #import "RJTypes.h"
23
+
24
+ #pragma mark - Gesture Types
25
+
26
+ RJGestureType const RJGestureTypeTap = @"tap";
27
+ RJGestureType const RJGestureTypeDoubleTap = @"double_tap";
28
+ RJGestureType const RJGestureTypeLongPress = @"long_press";
29
+ RJGestureType const RJGestureTypeForceTouch = @"force_touch";
30
+ RJGestureType const RJGestureTypeSwipeLeft = @"swipe_left";
31
+ RJGestureType const RJGestureTypeSwipeRight = @"swipe_right";
32
+ RJGestureType const RJGestureTypeSwipeUp = @"swipe_up";
33
+ RJGestureType const RJGestureTypeSwipeDown = @"swipe_down";
34
+ RJGestureType const RJGestureTypeScrollUp = @"scroll_up";
35
+ RJGestureType const RJGestureTypeScrollDown = @"scroll_down";
36
+ RJGestureType const RJGestureTypePinchIn = @"pinch_in";
37
+ RJGestureType const RJGestureTypePinchOut = @"pinch_out";
38
+ RJGestureType const RJGestureTypeRotateCW = @"rotate_cw";
39
+ RJGestureType const RJGestureTypeRotateCCW = @"rotate_ccw";
40
+ RJGestureType const RJGestureTypePanUp = @"pan_up";
41
+ RJGestureType const RJGestureTypePanDown = @"pan_down";
42
+ RJGestureType const RJGestureTypePanLeft = @"pan_left";
43
+ RJGestureType const RJGestureTypePanRight = @"pan_right";
44
+ RJGestureType const RJGestureTypeTwoFingerTap = @"two_finger_tap";
45
+ RJGestureType const RJGestureTypeThreeFingerGesture = @"three_finger_gesture";
46
+ RJGestureType const RJGestureTypeMultiTouch = @"multi_touch";
47
+ RJGestureType const RJGestureTypeKeyboardTap = @"keyboard_tap";
48
+
49
+ #pragma mark - Session Event Types
50
+
51
+ RJEventType const RJEventTypeSessionStart = @"session_start";
52
+ RJEventType const RJEventTypeSessionEnd = @"session_end";
53
+ RJEventType const RJEventTypeSessionTimeout = @"session_timeout";
54
+ RJEventType const RJEventTypeNavigation = @"navigation";
55
+ RJEventType const RJEventTypeGesture = @"gesture";
56
+ RJEventType const RJEventTypeVisualChange = @"visual_change";
57
+ RJEventType const RJEventTypeKeyboardShow = @"keyboard_show";
58
+ RJEventType const RJEventTypeKeyboardHide = @"keyboard_hide";
59
+ RJEventType const RJEventTypeKeyboardTyping = @"keyboard_typing";
60
+ RJEventType const RJEventTypeAppBackground = @"app_background";
61
+ RJEventType const RJEventTypeAppForeground = @"app_foreground";
62
+ RJEventType const RJEventTypeAppTerminated = @"app_terminated";
63
+ RJEventType const RJEventTypeExternalURLOpened = @"external_url_opened";
64
+ RJEventType const RJEventTypeOAuthStarted = @"oauth_started";
65
+ RJEventType const RJEventTypeOAuthCompleted = @"oauth_completed";
66
+ RJEventType const RJEventTypeOAuthReturned = @"oauth_returned";
@@ -0,0 +1,64 @@
1
+ //
2
+ // Rejourney.h
3
+ // Rejourney
4
+ //
5
+ // React Native TurboModule for session recording.
6
+ //
7
+ // Dual Architecture Support:
8
+ // - Old Architecture: Implements RCTBridgeModule
9
+ // - New Architecture: Implements NativeRejourneySpec (generated by Codegen)
10
+ //
11
+ // Licensed under the Apache License, Version 2.0 (the "License");
12
+ // you may not use this file except in compliance with the License.
13
+ // You may obtain a copy of the License at
14
+ //
15
+ // http://www.apache.org/licenses/LICENSE-2.0
16
+ //
17
+ // Unless required by applicable law or agreed to in writing, software
18
+ // distributed under the License is distributed on an "AS IS" BASIS,
19
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ // See the License for the specific language governing permissions and
21
+ // limitations under the License.
22
+ //
23
+ // Copyright (c) 2026 Rejourney
24
+ //
25
+
26
+ #ifndef Rejourney_Core_h
27
+ #define Rejourney_Core_h
28
+
29
+ #import <Foundation/Foundation.h>
30
+
31
+ #if __has_include(<React/RCTBridgeModule.h>)
32
+ #import <React/RCTBridgeModule.h>
33
+ #else
34
+ #import "RCTBridgeModule.h"
35
+ #endif
36
+
37
+ // New Architecture (TurboModules) support
38
+ #ifdef RCT_NEW_ARCH_ENABLED
39
+ #import <RejourneySpec/RejourneySpec.h>
40
+ #endif
41
+
42
+ NS_ASSUME_NONNULL_BEGIN
43
+
44
+ /**
45
+ * Rejourney Native Module
46
+ *
47
+ * Architecture Support:
48
+ * - Old Architecture: Conforms to RCTBridgeModule, uses RCT_EXPORT_METHOD macros
49
+ * - New Architecture: Also conforms to NativeRejourneySpec, implements getTurboModule:
50
+ *
51
+ * The module automatically detects the architecture at runtime and uses
52
+ * the appropriate communication channel (Bridge vs JSI).
53
+ */
54
+ #ifdef RCT_NEW_ARCH_ENABLED
55
+ @interface Rejourney : NSObject <RCTBridgeModule, NativeRejourneySpec>
56
+ #else
57
+ @interface Rejourney : NSObject <RCTBridgeModule>
58
+ #endif
59
+
60
+ @end
61
+
62
+ NS_ASSUME_NONNULL_END
63
+
64
+ #endif /* Rejourney_Core_h */