react-native-ux-cam 5.4.16 → 6.0.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/CHANGELOG.md +2 -0
- package/RNUxcam.podspec +22 -3
- package/android/build.gradle +39 -5
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +240 -0
- package/android/gradlew.bat +91 -0
- package/android/src/main/java/com/uxcam/RNUxViewFinder.java +7 -0
- package/android/src/main/java/com/uxcam/RNUxcamModuleImpl.java +446 -0
- package/android/src/main/java/com/uxcam/RNUxcamPackage.java +33 -18
- package/android/src/newarch/java/com/uxcam/RNUxcamModule.java +208 -0
- package/android/src/oldarch/java/com/uxcam/RNUxcamModule.java +205 -0
- package/ios/RNUxcam/RNUxcam.h +16 -0
- package/ios/RNUxcam/RNUxcam.mm +526 -0
- package/package.json +36 -32
- package/src/NativeRNUxcam.ts +60 -0
- package/src/UXCam.js +343 -0
- package/src/UXCamOcclusion.tsx +29 -0
- package/{index.d.ts → src/index.d.ts} +9 -130
- package/src/index.js +3 -0
- package/src/types.ts +19 -0
- package/UXCam.js +0 -570
- package/UXCamOcclusion.tsx +0 -36
- package/android/.classpath +0 -6
- package/android/src/main/java/com/uxcam/RNUxcamModule.java +0 -559
- package/index.js +0 -3
- package/ios/RNUxcam.h +0 -19
- package/ios/RNUxcam.m +0 -670
- package/ios/RNUxcam.xcodeproj/project.pbxproj +0 -266
- package/ios/RNUxcam.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNUxcam.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- /package/{jest.config.js → src/jest.config.js} +0 -0
- /package/{tsconfig.json → src/tsconfig.json} +0 -0
|
@@ -1,559 +0,0 @@
|
|
|
1
|
-
package com.uxcam;
|
|
2
|
-
|
|
3
|
-
import android.view.View;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.Arguments;
|
|
6
|
-
import com.facebook.react.bridge.NoSuchKeyException;
|
|
7
|
-
import com.facebook.react.bridge.Promise;
|
|
8
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
-
import com.facebook.react.bridge.ReactContext;
|
|
10
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
11
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
12
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
13
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
14
|
-
import com.facebook.react.bridge.ReadableType;
|
|
15
|
-
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
16
|
-
import com.facebook.react.bridge.UnexpectedNativeTypeException;
|
|
17
|
-
import com.facebook.react.bridge.WritableArray;
|
|
18
|
-
import com.facebook.react.bridge.WritableMap;
|
|
19
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
20
|
-
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
21
|
-
import com.facebook.react.uimanager.UIBlock;
|
|
22
|
-
import com.facebook.react.uimanager.UIManagerModule;
|
|
23
|
-
|
|
24
|
-
import java.util.ArrayList;
|
|
25
|
-
import java.util.HashMap;
|
|
26
|
-
import java.util.List;
|
|
27
|
-
import java.util.Map;
|
|
28
|
-
|
|
29
|
-
import android.util.Log;
|
|
30
|
-
|
|
31
|
-
import com.uxcam.UXCam;
|
|
32
|
-
import com.uxcam.screenshot.model.UXCamBlur;
|
|
33
|
-
import com.uxcam.screenshot.model.UXCamOverlay;
|
|
34
|
-
import com.uxcam.screenshot.model.UXCamOcclusion;
|
|
35
|
-
import com.uxcam.screenshot.model.UXCamOccludeAllTextFields;
|
|
36
|
-
import com.uxcam.datamodel.UXConfig;
|
|
37
|
-
|
|
38
|
-
public class RNUxcamModule extends ReactContextBaseJavaModule {
|
|
39
|
-
private static final String UXCAM_PLUGIN_TYPE = "react-native";
|
|
40
|
-
private static final String UXCAM_REACT_PLUGIN_VERSION = "5.4.16";
|
|
41
|
-
|
|
42
|
-
private static final String UXCAM_VERIFICATION_EVENT_KEY = "UXCam_Verification_Event";
|
|
43
|
-
private static final String PARAM_SUCCESS_KEY = "success";
|
|
44
|
-
private static final String PARAM_ERROR_MESSAGE_KEY = "error";
|
|
45
|
-
|
|
46
|
-
public static final String USER_APP_KEY = "userAppKey";
|
|
47
|
-
public static final String ENABLE_MUTLI_SESSION_RECORD = "enableMultiSessionRecord";
|
|
48
|
-
public static final String ENABLE_CRASH_HANDLING = "enableCrashHandling";
|
|
49
|
-
public static final String ENABLE_AUTOMATIC_SCREEN_NAME_TAGGING = "enableAutomaticScreenNameTagging";
|
|
50
|
-
public static final String ENABLE_IMPROVED_SCREEN_CAPTURE = "enableImprovedScreenCapture";
|
|
51
|
-
public static final String OCCLUSION = "occlusions";
|
|
52
|
-
public static final String SCREENS = "screens";
|
|
53
|
-
public static final String NAME = "name";
|
|
54
|
-
public static final String TYPE = "type";
|
|
55
|
-
public static final String EXCLUDE_MENTIONED_SCREENS = "excludeMentionedScreens";
|
|
56
|
-
public static final String CONFIG = "config";
|
|
57
|
-
public static final String BLUR_RADIUS = "blurRadius";
|
|
58
|
-
public static final String HIDE_GESTURES = "hideGestures";
|
|
59
|
-
|
|
60
|
-
private final ReactApplicationContext reactContext;
|
|
61
|
-
|
|
62
|
-
public RNUxcamModule(ReactApplicationContext reactContext) {
|
|
63
|
-
super(reactContext);
|
|
64
|
-
this.reactContext = reactContext;
|
|
65
|
-
UXCam.addVerificationListener(new OnVerificationListener() {
|
|
66
|
-
@Override
|
|
67
|
-
public void onVerificationSuccess() {
|
|
68
|
-
WritableMap params = Arguments.createMap();
|
|
69
|
-
params.putBoolean(PARAM_SUCCESS_KEY, true);
|
|
70
|
-
sendEvent(RNUxcamModule.this.reactContext, UXCAM_VERIFICATION_EVENT_KEY, params);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@Override
|
|
74
|
-
public void onVerificationFailed(String errorMessage) {
|
|
75
|
-
WritableMap params = Arguments.createMap();
|
|
76
|
-
params.putBoolean(PARAM_SUCCESS_KEY, false);
|
|
77
|
-
params.putString(PARAM_ERROR_MESSAGE_KEY, errorMessage);
|
|
78
|
-
sendEvent(RNUxcamModule.this.reactContext, UXCAM_VERIFICATION_EVENT_KEY, params);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private void sendEvent(ReactContext reactContext,
|
|
84
|
-
String eventName, WritableMap params) {
|
|
85
|
-
reactContext
|
|
86
|
-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
87
|
-
.emit(eventName, params);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@Override
|
|
91
|
-
public String getName() {
|
|
92
|
-
return "RNUxcam";
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@ReactMethod
|
|
96
|
-
public void startWithKey(String key) {
|
|
97
|
-
UXCam.pluginType(UXCAM_PLUGIN_TYPE, UXCAM_REACT_PLUGIN_VERSION);
|
|
98
|
-
UXCam.startApplicationWithKeyForCordova(getCurrentActivity(), key);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@ReactMethod
|
|
102
|
-
public void startWithConfiguration(ReadableMap configuration) {
|
|
103
|
-
try {
|
|
104
|
-
HashMap<String, Object> configMap = configuration.toHashMap();
|
|
105
|
-
String appKey = (String) configMap.get(USER_APP_KEY);
|
|
106
|
-
Boolean enableMultiSessionRecord = (Boolean) configMap.get(ENABLE_MUTLI_SESSION_RECORD);
|
|
107
|
-
Boolean enableCrashHandling = (Boolean) configMap.get(ENABLE_CRASH_HANDLING);
|
|
108
|
-
Boolean enableAutomaticScreenNameTagging = (Boolean) configMap.get(ENABLE_AUTOMATIC_SCREEN_NAME_TAGGING);
|
|
109
|
-
Boolean enableImprovedScreenCapture = (Boolean) configMap.get(ENABLE_IMPROVED_SCREEN_CAPTURE);
|
|
110
|
-
|
|
111
|
-
// // occlusion
|
|
112
|
-
List<UXCamOcclusion> occlusionList = null;
|
|
113
|
-
if (configMap.get(OCCLUSION) != null) {
|
|
114
|
-
List<Map<String, Object>> occlusionObjects = (List<Map<String, Object>>) configMap.get(OCCLUSION);
|
|
115
|
-
occlusionList = convertToOcclusionList(occlusionObjects);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
UXConfig.Builder uxConfigBuilder = new UXConfig.Builder(appKey);
|
|
119
|
-
if (enableMultiSessionRecord != null)
|
|
120
|
-
uxConfigBuilder.enableMultiSessionRecord(enableMultiSessionRecord);
|
|
121
|
-
if (enableCrashHandling != null)
|
|
122
|
-
uxConfigBuilder.enableCrashHandling(enableCrashHandling);
|
|
123
|
-
if (enableAutomaticScreenNameTagging != null)
|
|
124
|
-
uxConfigBuilder.enableAutomaticScreenNameTagging(enableAutomaticScreenNameTagging);
|
|
125
|
-
if (enableImprovedScreenCapture != null) {
|
|
126
|
-
Log.d("config", "improved screen capture enabled " + enableImprovedScreenCapture);
|
|
127
|
-
uxConfigBuilder.enableImprovedScreenCapture(enableImprovedScreenCapture);
|
|
128
|
-
}
|
|
129
|
-
if (occlusionList != null)
|
|
130
|
-
uxConfigBuilder.occlusions(occlusionList);
|
|
131
|
-
|
|
132
|
-
UXConfig config = uxConfigBuilder.build();
|
|
133
|
-
UXCam.pluginType(UXCAM_PLUGIN_TYPE, UXCAM_REACT_PLUGIN_VERSION);
|
|
134
|
-
UXCam.startWithConfigurationCrossPlatform(getCurrentActivity(), config);
|
|
135
|
-
} catch (Exception e) {
|
|
136
|
-
Log.d("config", "Error starting with configuration");
|
|
137
|
-
e.printStackTrace();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
private List<UXCamOcclusion> convertToOcclusionList(List<Map<String, Object>> occlusionObjects) {
|
|
142
|
-
List<UXCamOcclusion> occlusionList = new ArrayList<UXCamOcclusion>();
|
|
143
|
-
for (Map<String, Object> occlusionMap :
|
|
144
|
-
occlusionObjects) {
|
|
145
|
-
UXCamOcclusion occlusion = getOcclusion(occlusionMap);
|
|
146
|
-
if (occlusion != null)
|
|
147
|
-
occlusionList.add(getOcclusion(occlusionMap));
|
|
148
|
-
}
|
|
149
|
-
return occlusionList;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
private UXCamOcclusion getOcclusion(Map<String, Object> occlusionMap) {
|
|
153
|
-
double typeIndex = (double) occlusionMap.get(TYPE);
|
|
154
|
-
switch ((int)typeIndex) {
|
|
155
|
-
case 1:
|
|
156
|
-
return (UXCamOcclusion) getOccludeAllTextFields();
|
|
157
|
-
case 2:
|
|
158
|
-
return (UXCamOcclusion) getOverlay(occlusionMap);
|
|
159
|
-
case 3:
|
|
160
|
-
return (UXCamOcclusion) getBlur(occlusionMap);
|
|
161
|
-
default:
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
private UXCamOccludeAllTextFields getOccludeAllTextFields() {
|
|
167
|
-
return new UXCamOccludeAllTextFields.Builder().build();
|
|
168
|
-
}
|
|
169
|
-
private UXCamOverlay getOverlay(Map<String, Object> overlayMap) {
|
|
170
|
-
// get data
|
|
171
|
-
List<String> screens = (List<String>) overlayMap.get(SCREENS);
|
|
172
|
-
Boolean excludeMentionedScreens = (Boolean) overlayMap.get(EXCLUDE_MENTIONED_SCREENS);
|
|
173
|
-
Boolean hideGestures = (Boolean) overlayMap.get(HIDE_GESTURES);
|
|
174
|
-
|
|
175
|
-
// set data
|
|
176
|
-
UXCamOverlay.Builder overlayBuilder = new UXCamOverlay.Builder();
|
|
177
|
-
if (screens != null && !screens.isEmpty())
|
|
178
|
-
overlayBuilder.screens(screens);
|
|
179
|
-
if (excludeMentionedScreens != null)
|
|
180
|
-
overlayBuilder.excludeMentionedScreens(excludeMentionedScreens);
|
|
181
|
-
if (hideGestures != null)
|
|
182
|
-
overlayBuilder.withoutGesture(hideGestures);
|
|
183
|
-
return overlayBuilder.build();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private UXCamBlur getBlur(Map<String, Object> blurMap) {
|
|
187
|
-
// get data
|
|
188
|
-
List<String> screens = (List<String>) blurMap.get(SCREENS);
|
|
189
|
-
Boolean excludeMentionedScreens = (Boolean) blurMap.get(EXCLUDE_MENTIONED_SCREENS);
|
|
190
|
-
Double blurRadius = (Double) blurMap.get(BLUR_RADIUS);
|
|
191
|
-
Boolean hideGestures = (Boolean) blurMap.get(HIDE_GESTURES);
|
|
192
|
-
|
|
193
|
-
// set data
|
|
194
|
-
UXCamBlur.Builder blurBuilder = new UXCamBlur.Builder();
|
|
195
|
-
if (screens != null && !screens.isEmpty())
|
|
196
|
-
blurBuilder.screens(screens);
|
|
197
|
-
if (excludeMentionedScreens != null)
|
|
198
|
-
blurBuilder.excludeMentionedScreens(excludeMentionedScreens);
|
|
199
|
-
if (blurRadius != null)
|
|
200
|
-
blurBuilder.blurRadius(blurRadius.intValue());
|
|
201
|
-
if (hideGestures != null)
|
|
202
|
-
blurBuilder.withoutGesture(hideGestures);
|
|
203
|
-
return blurBuilder.build();
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
@ReactMethod
|
|
207
|
-
public void applyOcclusion(ReadableMap occlusionMap) {
|
|
208
|
-
UXCamOcclusion occlusion = getOcclusion(occlusionMap.toHashMap());
|
|
209
|
-
UXCam.applyOcclusion(occlusion);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
@ReactMethod
|
|
213
|
-
public void removeOcclusion(ReadableMap occlusionMap) {
|
|
214
|
-
UXCamOcclusion occlusion = getOcclusion(occlusionMap.toHashMap());
|
|
215
|
-
UXCam.removeOcclusion(occlusion);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
@ReactMethod
|
|
219
|
-
public void startNewSession() {
|
|
220
|
-
UXCam.startNewSession();
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
@ReactMethod
|
|
224
|
-
public void stopSessionAndUploadData() {
|
|
225
|
-
UXCam.stopSessionAndUploadData();
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
@ReactMethod
|
|
229
|
-
public void occludeSensitiveScreen(boolean occlude) {
|
|
230
|
-
UXCam.occludeSensitiveScreen(occlude, false);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
@ReactMethod
|
|
234
|
-
public void occludeSensitiveScreen(boolean occlude, boolean hideGesture) {
|
|
235
|
-
UXCam.occludeSensitiveScreen(occlude, hideGesture);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
@ReactMethod
|
|
239
|
-
public void occludeAllTextFields(boolean occlude) {
|
|
240
|
-
UXCam.occludeAllTextFields(occlude);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
@ReactMethod
|
|
244
|
-
public void tagScreenName(String screenName) {
|
|
245
|
-
UXCam.tagScreenName(screenName);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
@ReactMethod
|
|
249
|
-
public void setAutomaticScreenNameTagging(boolean autoScreenTagging) {
|
|
250
|
-
UXCam.setAutomaticScreenNameTagging(autoScreenTagging);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
@ReactMethod
|
|
254
|
-
public void addScreenNameToIgnore(String screenName) {
|
|
255
|
-
UXCam.addScreenNameToIgnore(screenName);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
@ReactMethod
|
|
259
|
-
public void addScreenNamesToIgnore(ReadableArray screenNames) {
|
|
260
|
-
ArrayList<Object> list = screenNames.toArrayList();
|
|
261
|
-
for (Object screenName : list) {
|
|
262
|
-
UXCam.addScreenNameToIgnore(screenName.toString());
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
@ReactMethod
|
|
267
|
-
public void removeScreenNameToIgnore(String screenName) {
|
|
268
|
-
UXCam.removeScreenNameToIgnore(screenName);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@ReactMethod
|
|
272
|
-
public void removeScreenNamesToIgnore(ReadableArray screenNames) {
|
|
273
|
-
ArrayList<Object> list = screenNames.toArrayList();
|
|
274
|
-
for (Object screenName : list) {
|
|
275
|
-
UXCam.removeScreenNameToIgnore(screenName.toString());
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
@ReactMethod
|
|
280
|
-
public void removeAllScreenNamesToIgnore() {
|
|
281
|
-
UXCam.removeAllScreenNamesToIgnore();
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
@ReactMethod
|
|
285
|
-
public void screenNamesBeingIgnored(Promise promise) {
|
|
286
|
-
List<String> list = UXCam.screenNamesBeingIgnored();
|
|
287
|
-
WritableArray promiseArray = Arguments.createArray();
|
|
288
|
-
for (String screen : list) {
|
|
289
|
-
promiseArray.pushString(screen);
|
|
290
|
-
}
|
|
291
|
-
promise.resolve(promiseArray);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@ReactMethod
|
|
295
|
-
public void setUserIdentity(String id) {
|
|
296
|
-
UXCam.setUserIdentity(id);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
@ReactMethod
|
|
300
|
-
public void setUserProperty(String key, String value) {
|
|
301
|
-
UXCam.setUserProperty(key, value);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
@ReactMethod
|
|
305
|
-
public void setSessionProperty(String key, String value) {
|
|
306
|
-
UXCam.setSessionProperty(key, value);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
@ReactMethod
|
|
310
|
-
public void logEvent(String event) {
|
|
311
|
-
UXCam.logEvent(event);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
@ReactMethod
|
|
315
|
-
public void logEvent(String event, ReadableMap properties) {
|
|
316
|
-
HashMap<String, Object> convertedProperties = new HashMap<>();
|
|
317
|
-
|
|
318
|
-
if (properties != null) {
|
|
319
|
-
ReadableMapKeySetIterator iterator = properties.keySetIterator();
|
|
320
|
-
|
|
321
|
-
while (iterator.hasNextKey()) {
|
|
322
|
-
String key = iterator.nextKey();
|
|
323
|
-
ReadableType type = properties.getType(key);
|
|
324
|
-
try {
|
|
325
|
-
switch (type) {
|
|
326
|
-
case Null:
|
|
327
|
-
convertedProperties.put(key, "");
|
|
328
|
-
case Boolean:
|
|
329
|
-
convertedProperties.put(key, properties.getBoolean(key));
|
|
330
|
-
break;
|
|
331
|
-
case Number:
|
|
332
|
-
convertedProperties.put(key, properties.getDouble(key));
|
|
333
|
-
break;
|
|
334
|
-
case String:
|
|
335
|
-
convertedProperties.put(key, properties.getString(key));
|
|
336
|
-
break;
|
|
337
|
-
case Map:
|
|
338
|
-
convertedProperties.put(key, properties.getMap(key).toString());
|
|
339
|
-
break;
|
|
340
|
-
case Array:
|
|
341
|
-
convertedProperties.put(key, properties.getArray(key).toString());
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
} catch (NullPointerException | NoSuchKeyException | UnexpectedNativeTypeException e) {
|
|
345
|
-
convertedProperties.put(key, "");
|
|
346
|
-
e.printStackTrace();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
UXCam.logEvent(event, convertedProperties);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@ReactMethod
|
|
355
|
-
public void addVerificationListener(final Promise promise) {
|
|
356
|
-
UXCam.addVerificationListener(new OnVerificationListener() {
|
|
357
|
-
@Override
|
|
358
|
-
public void onVerificationSuccess() {
|
|
359
|
-
promise.resolve("success");
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
@Override
|
|
363
|
-
public void onVerificationFailed(String errorMessage) {
|
|
364
|
-
Throwable error = new Throwable(errorMessage);
|
|
365
|
-
promise.reject("failed", errorMessage, error);
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
@ReactMethod
|
|
371
|
-
public void urlForCurrentSession(Promise promise) {
|
|
372
|
-
promise.resolve(UXCam.urlForCurrentSession());
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
@ReactMethod
|
|
376
|
-
public void urlForCurrentUser(Promise promise) {
|
|
377
|
-
promise.resolve(UXCam.urlForCurrentUser());
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
@ReactMethod
|
|
381
|
-
public void isRecording(Promise promise) {
|
|
382
|
-
promise.resolve(UXCam.isRecording());
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
@ReactMethod
|
|
386
|
-
public void pauseScreenRecording() {
|
|
387
|
-
UXCam.pauseScreenRecording();
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
@ReactMethod
|
|
391
|
-
public void resumeScreenRecording() {
|
|
392
|
-
UXCam.resumeScreenRecording();
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
@ReactMethod
|
|
396
|
-
public void optInOverall() {
|
|
397
|
-
UXCam.optIn();
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
@ReactMethod
|
|
401
|
-
public void optOutOverall() {
|
|
402
|
-
UXCam.optOut();
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
@ReactMethod
|
|
406
|
-
public void optInOverallStatus(Promise promise) {
|
|
407
|
-
promise.resolve(UXCam.optStatus());
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
@ReactMethod
|
|
411
|
-
public void optIntoVideoRecording(){
|
|
412
|
-
UXCam.optIntoVideoRecording();
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
@ReactMethod
|
|
416
|
-
public void optOutOfVideoRecording(){
|
|
417
|
-
UXCam.optOutOfVideoRecording();
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
@ReactMethod
|
|
421
|
-
public void optInVideoRecordingStatus(Promise promise){
|
|
422
|
-
promise.resolve(UXCam.optInVideoRecordingStatus());
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
@ReactMethod
|
|
426
|
-
public void cancelCurrentSession() {
|
|
427
|
-
UXCam.cancelCurrentSession();
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
@ReactMethod
|
|
431
|
-
public void allowShortBreakForAnotherApp(boolean startShortBreak) {
|
|
432
|
-
UXCam.allowShortBreakForAnotherApp(startShortBreak);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
@ReactMethod
|
|
436
|
-
public void allowShortBreakForAnotherAppInMillis(int millis) {
|
|
437
|
-
UXCam.allowShortBreakForAnotherApp(millis);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
@ReactMethod
|
|
441
|
-
public void getMultiSessionRecord(Promise promise) {
|
|
442
|
-
promise.resolve(UXCam.getMultiSessionRecord());
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
@ReactMethod
|
|
446
|
-
public void setMultiSessionRecord(boolean multiSessionRecord) {
|
|
447
|
-
UXCam.setMultiSessionRecord(multiSessionRecord);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
@ReactMethod
|
|
451
|
-
public void deletePendingUploads() {
|
|
452
|
-
UXCam.deletePendingUploads();
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
@ReactMethod
|
|
456
|
-
public void pendingSessionCount(Promise promise) {
|
|
457
|
-
promise.resolve(UXCam.pendingSessionCount());
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
@ReactMethod
|
|
461
|
-
public void uploadPendingSession() {}
|
|
462
|
-
|
|
463
|
-
@ReactMethod
|
|
464
|
-
public void occludeSensitiveView(final int id) {
|
|
465
|
-
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
|
|
466
|
-
uiManager.addUIBlock(new UIBlock() {
|
|
467
|
-
@Override
|
|
468
|
-
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
|
469
|
-
try {
|
|
470
|
-
View view = nativeViewHierarchyManager.resolveView(id);
|
|
471
|
-
|
|
472
|
-
if (view != null)
|
|
473
|
-
UXCam.occludeSensitiveView(view);
|
|
474
|
-
} catch (Exception e) {
|
|
475
|
-
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
@ReactMethod
|
|
483
|
-
public void unOccludeSensitiveView(final int id) {
|
|
484
|
-
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
|
|
485
|
-
uiManager.addUIBlock(new UIBlock() {
|
|
486
|
-
@Override
|
|
487
|
-
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
|
488
|
-
try {
|
|
489
|
-
View view = nativeViewHierarchyManager.resolveView(id);
|
|
490
|
-
|
|
491
|
-
if (view != null)
|
|
492
|
-
UXCam.unOccludeSensitiveView(view);
|
|
493
|
-
} catch (Exception e) {
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
@ReactMethod
|
|
502
|
-
public void occludeSensitiveViewWithoutGesture(final int id) {
|
|
503
|
-
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
|
|
504
|
-
uiManager.addUIBlock(new UIBlock() {
|
|
505
|
-
@Override
|
|
506
|
-
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
|
507
|
-
try {
|
|
508
|
-
View view = nativeViewHierarchyManager.resolveView(id);
|
|
509
|
-
|
|
510
|
-
if (view != null)
|
|
511
|
-
UXCam.occludeSensitiveViewWithoutGesture(view);
|
|
512
|
-
} catch (Exception e) {
|
|
513
|
-
e.printStackTrace();
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
@ReactMethod
|
|
520
|
-
public void setPushNotificationToken(String token) {
|
|
521
|
-
UXCam.setPushNotificationToken(token);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
@ReactMethod
|
|
525
|
-
public void reportBugEvent(String event) {
|
|
526
|
-
UXCam.reportBugEvent(event);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
@ReactMethod
|
|
530
|
-
public void reportBugEvent(String event, ReadableMap properties) {
|
|
531
|
-
if (properties != null) {
|
|
532
|
-
|
|
533
|
-
HashMap<String, Object> map = new HashMap<String, Object>();
|
|
534
|
-
|
|
535
|
-
ReadableMapKeySetIterator iterator = properties.keySetIterator();
|
|
536
|
-
while (iterator.hasNextKey()) {
|
|
537
|
-
String key = iterator.nextKey();
|
|
538
|
-
ReadableType type = properties.getType(key);
|
|
539
|
-
if (type == ReadableType.Boolean) {
|
|
540
|
-
map.put(key, properties.getBoolean(key));
|
|
541
|
-
} else if (type == ReadableType.Number) {
|
|
542
|
-
map.put(key, properties.getDouble(key));
|
|
543
|
-
} else {
|
|
544
|
-
map.put(key, properties.getString(key));
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
UXCam.reportBugEvent(event, map);
|
|
548
|
-
} else {
|
|
549
|
-
UXCam.reportBugEvent(event);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
@ReactMethod
|
|
555
|
-
public void disableCrashHandling(boolean disable) {
|
|
556
|
-
UXCam.disableCrashHandling(disable);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
}
|
package/index.js
DELETED
package/ios/RNUxcam.h
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// #if __has_include("RCTBridgeModule.h")
|
|
3
|
-
// #import "RCTBridgeModule.h"
|
|
4
|
-
// #else
|
|
5
|
-
// #import <React/RCTBridgeModule.h>
|
|
6
|
-
// #endif
|
|
7
|
-
// #if __has_include("RCTUIManager.h")
|
|
8
|
-
// #import "RCTUIManager.h"
|
|
9
|
-
// #else
|
|
10
|
-
// #import <React/RCTUIManager.h>
|
|
11
|
-
// #endif
|
|
12
|
-
|
|
13
|
-
#import <React/RCTBridgeModule.h>
|
|
14
|
-
#import <React/RCTEventEmitter.h>
|
|
15
|
-
|
|
16
|
-
@interface RNUxcam : RCTEventEmitter <RCTBridgeModule>
|
|
17
|
-
|
|
18
|
-
@end
|
|
19
|
-
|