omnipay-reactnative-sdk 1.2.2-beta.8 → 1.2.3-beta.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.
- package/README.md +43 -93
- package/android/build.gradle +0 -9
- package/android/src/main/AndroidManifest.xml +0 -5
- package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +1 -4
- package/lib/commonjs/components/OmnipayProvider.js +1 -1
- package/lib/commonjs/components/biometrics/FaceVerification.js +235 -275
- package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/commonjs/index.js +0 -33
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/OmnipayProvider.js +1 -1
- package/lib/module/components/biometrics/FaceVerification.js +237 -277
- package/lib/module/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/module/index.js +0 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/biometrics/FaceVerification.d.ts +1 -3
- package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/components/OmnipayProvider.tsx +1 -1
- package/src/components/biometrics/FaceVerification.tsx +232 -317
- package/src/index.tsx +0 -7
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraView.java +0 -153
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraViewManager.java +0 -49
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessModule.java +0 -557
- package/ios/OmnipayLivenessCameraView.h +0 -15
- package/ios/OmnipayLivenessCameraView.m +0 -80
- package/ios/OmnipayLivenessCameraViewManager.m +0 -19
- package/ios/OmnipayLivenessModule.h +0 -38
- package/ios/OmnipayLivenessModule.m +0 -615
- package/lib/commonjs/components/biometrics/LivenessDetection.js +0 -149
- package/lib/commonjs/components/biometrics/LivenessDetection.js.map +0 -1
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js +0 -15
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js.map +0 -1
- package/lib/commonjs/components/biometrics/PermissionManager.js +0 -279
- package/lib/commonjs/components/biometrics/PermissionManager.js.map +0 -1
- package/lib/commonjs/components/biometrics/index.js +0 -45
- package/lib/commonjs/components/biometrics/index.js.map +0 -1
- package/lib/commonjs/components/biometrics/types.js +0 -17
- package/lib/commonjs/components/biometrics/types.js.map +0 -1
- package/lib/module/components/biometrics/LivenessDetection.js +0 -129
- package/lib/module/components/biometrics/LivenessDetection.js.map +0 -1
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js +0 -7
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js.map +0 -1
- package/lib/module/components/biometrics/PermissionManager.js +0 -272
- package/lib/module/components/biometrics/PermissionManager.js.map +0 -1
- package/lib/module/components/biometrics/index.js +0 -12
- package/lib/module/components/biometrics/index.js.map +0 -1
- package/lib/module/components/biometrics/types.js +0 -16
- package/lib/module/components/biometrics/types.js.map +0 -1
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts +0 -33
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts +0 -18
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/PermissionManager.d.ts +0 -58
- package/lib/typescript/components/biometrics/PermissionManager.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/index.d.ts +0 -5
- package/lib/typescript/components/biometrics/index.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/types.d.ts +0 -73
- package/lib/typescript/components/biometrics/types.d.ts.map +0 -1
- package/omnipay-reactnative-sdk.podspec +0 -50
- package/src/components/biometrics/LivenessDetection.ts +0 -178
- package/src/components/biometrics/OmnipayLivenessCameraView.tsx +0 -19
- package/src/components/biometrics/PermissionManager.ts +0 -317
- package/src/components/biometrics/index.ts +0 -11
- package/src/components/biometrics/types.ts +0 -86
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
package com.omniretail.omnipay;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
import android.util.AttributeSet;
|
|
5
|
-
import android.util.Log;
|
|
6
|
-
import android.view.LayoutInflater;
|
|
7
|
-
import android.view.View;
|
|
8
|
-
import android.widget.FrameLayout;
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.NonNull;
|
|
11
|
-
import androidx.annotation.Nullable;
|
|
12
|
-
import androidx.camera.core.CameraSelector;
|
|
13
|
-
import androidx.camera.core.Preview;
|
|
14
|
-
import androidx.camera.lifecycle.ProcessCameraProvider;
|
|
15
|
-
import androidx.camera.view.PreviewView;
|
|
16
|
-
import androidx.core.content.ContextCompat;
|
|
17
|
-
import androidx.lifecycle.LifecycleOwner;
|
|
18
|
-
|
|
19
|
-
import com.facebook.react.bridge.Arguments;
|
|
20
|
-
import com.facebook.react.bridge.ReactContext;
|
|
21
|
-
import com.facebook.react.bridge.WritableMap;
|
|
22
|
-
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
23
|
-
import com.google.common.util.concurrent.ListenableFuture;
|
|
24
|
-
|
|
25
|
-
import java.util.concurrent.ExecutionException;
|
|
26
|
-
|
|
27
|
-
public class OmnipayLivenessCameraView extends FrameLayout {
|
|
28
|
-
private static final String TAG = "OmnipayLivenessCameraView";
|
|
29
|
-
|
|
30
|
-
private PreviewView previewView;
|
|
31
|
-
private ProcessCameraProvider cameraProvider;
|
|
32
|
-
private Preview preview;
|
|
33
|
-
private boolean isInitialized = false;
|
|
34
|
-
|
|
35
|
-
public OmnipayLivenessCameraView(@NonNull Context context) {
|
|
36
|
-
super(context);
|
|
37
|
-
init();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public OmnipayLivenessCameraView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
|
41
|
-
super(context, attrs);
|
|
42
|
-
init();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public OmnipayLivenessCameraView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
|
46
|
-
super(context, attrs, defStyleAttr);
|
|
47
|
-
init();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private void init() {
|
|
51
|
-
// Create and add PreviewView
|
|
52
|
-
previewView = new PreviewView(getContext());
|
|
53
|
-
previewView.setLayoutParams(new FrameLayout.LayoutParams(
|
|
54
|
-
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
55
|
-
FrameLayout.LayoutParams.MATCH_PARENT
|
|
56
|
-
));
|
|
57
|
-
previewView.setScaleType(PreviewView.ScaleType.FILL_CENTER);
|
|
58
|
-
addView(previewView);
|
|
59
|
-
|
|
60
|
-
// Initialize camera
|
|
61
|
-
initializeCamera();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private void initializeCamera() {
|
|
65
|
-
ListenableFuture<ProcessCameraProvider> cameraProviderFuture =
|
|
66
|
-
ProcessCameraProvider.getInstance(getContext());
|
|
67
|
-
|
|
68
|
-
cameraProviderFuture.addListener(() -> {
|
|
69
|
-
try {
|
|
70
|
-
cameraProvider = cameraProviderFuture.get();
|
|
71
|
-
setupCamera();
|
|
72
|
-
isInitialized = true;
|
|
73
|
-
sendEvent("onCameraReady", Arguments.createMap());
|
|
74
|
-
} catch (ExecutionException | InterruptedException e) {
|
|
75
|
-
Log.e(TAG, "Error initializing camera", e);
|
|
76
|
-
WritableMap errorMap = Arguments.createMap();
|
|
77
|
-
errorMap.putString("error", "Failed to initialize camera: " + e.getMessage());
|
|
78
|
-
sendEvent("onCameraError", errorMap);
|
|
79
|
-
}
|
|
80
|
-
}, ContextCompat.getMainExecutor(getContext()));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private void setupCamera() {
|
|
84
|
-
if (cameraProvider == null) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Create preview use case
|
|
89
|
-
preview = new Preview.Builder().build();
|
|
90
|
-
|
|
91
|
-
// Connect preview to PreviewView
|
|
92
|
-
preview.setSurfaceProvider(previewView.getSurfaceProvider());
|
|
93
|
-
|
|
94
|
-
// Select front camera
|
|
95
|
-
CameraSelector cameraSelector = CameraSelector.DEFAULT_FRONT_CAMERA;
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
// Unbind all use cases before rebinding
|
|
99
|
-
cameraProvider.unbindAll();
|
|
100
|
-
|
|
101
|
-
// Bind preview to camera
|
|
102
|
-
if (getContext() instanceof LifecycleOwner) {
|
|
103
|
-
cameraProvider.bindToLifecycle(
|
|
104
|
-
(LifecycleOwner) getContext(),
|
|
105
|
-
cameraSelector,
|
|
106
|
-
preview
|
|
107
|
-
);
|
|
108
|
-
} else {
|
|
109
|
-
Log.w(TAG, "Context is not a LifecycleOwner, camera preview may not work properly");
|
|
110
|
-
}
|
|
111
|
-
} catch (Exception e) {
|
|
112
|
-
Log.e(TAG, "Error binding camera", e);
|
|
113
|
-
WritableMap errorMap = Arguments.createMap();
|
|
114
|
-
errorMap.putString("error", "Failed to bind camera: " + e.getMessage());
|
|
115
|
-
sendEvent("onCameraError", errorMap);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
public void setupCameraPreview(ProcessCameraProvider cameraProvider) {
|
|
120
|
-
this.cameraProvider = cameraProvider;
|
|
121
|
-
if (isInitialized) {
|
|
122
|
-
setupCamera();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
public void startPreview() {
|
|
127
|
-
if (preview != null && cameraProvider != null) {
|
|
128
|
-
// Camera preview is automatically started when bound to lifecycle
|
|
129
|
-
Log.d(TAG, "Camera preview started");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
public void stopPreview() {
|
|
134
|
-
if (cameraProvider != null) {
|
|
135
|
-
cameraProvider.unbindAll();
|
|
136
|
-
Log.d(TAG, "Camera preview stopped");
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@Override
|
|
141
|
-
protected void onDetachedFromWindow() {
|
|
142
|
-
super.onDetachedFromWindow();
|
|
143
|
-
stopPreview();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private void sendEvent(String eventName, WritableMap params) {
|
|
147
|
-
ReactContext reactContext = (ReactContext) getContext();
|
|
148
|
-
if (reactContext != null) {
|
|
149
|
-
reactContext.getJSModule(RCTEventEmitter.class)
|
|
150
|
-
.receiveEvent(getId(), eventName, params);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
package com.omniretail.omnipay;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
import androidx.annotation.Nullable;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.common.MapBuilder;
|
|
8
|
-
import com.facebook.react.uimanager.SimpleViewManager;
|
|
9
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
11
|
-
|
|
12
|
-
import java.util.Map;
|
|
13
|
-
|
|
14
|
-
public class OmnipayLivenessCameraViewManager extends SimpleViewManager<OmnipayLivenessCameraView> {
|
|
15
|
-
public static final String REACT_CLASS = "OmnipayLivenessCameraView";
|
|
16
|
-
|
|
17
|
-
private ReactApplicationContext reactContext;
|
|
18
|
-
|
|
19
|
-
public OmnipayLivenessCameraViewManager(ReactApplicationContext reactContext) {
|
|
20
|
-
this.reactContext = reactContext;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@NonNull
|
|
24
|
-
@Override
|
|
25
|
-
public String getName() {
|
|
26
|
-
return REACT_CLASS;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@NonNull
|
|
30
|
-
@Override
|
|
31
|
-
protected OmnipayLivenessCameraView createViewInstance(@NonNull ThemedReactContext reactContext) {
|
|
32
|
-
return new OmnipayLivenessCameraView(reactContext);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@Nullable
|
|
36
|
-
@Override
|
|
37
|
-
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
38
|
-
return MapBuilder.<String, Object>builder()
|
|
39
|
-
.put("onCameraReady", MapBuilder.of("registrationName", "onCameraReady"))
|
|
40
|
-
.put("onCameraError", MapBuilder.of("registrationName", "onCameraError"))
|
|
41
|
-
.build();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@Override
|
|
45
|
-
public void onDropViewInstance(@NonNull OmnipayLivenessCameraView view) {
|
|
46
|
-
view.stopPreview();
|
|
47
|
-
super.onDropViewInstance(view);
|
|
48
|
-
}
|
|
49
|
-
}
|