@regulaforensics/face-sdk 6.3.58-beta → 6.3.72-beta
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 +1 -6
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +1 -1
- package/examples/capacitor/README.md +25 -23
- package/examples/capacitor/package.json +1 -1
- package/examples/cordova/README.md +27 -0
- package/examples/cordova/package.json +1 -1
- package/examples/ionic/README.md +27 -0
- package/examples/ionic/package.json +1 -1
- package/examples/react-native/README.md +2 -2
- package/examples/react-native/package.json +1 -1
- package/ios/CVDFaceSDK.m +5 -7
- package/ios/RFSWConfig.m +4 -0
- package/ios/RFSWMain.h +4 -4
- package/ios/RFSWMain.m +28 -21
- package/ios/RNFaceSDK.h +0 -1
- package/ios/RNFaceSDK.m +7 -10
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/www/capacitor/customization/font.js +9 -3
- package/www/cordova.js +9 -2
- package/www/react-native/customization/font.js +9 -3
- package/www/types/customization/font.d.ts +12 -4
package/README.md
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
Face SDK is a framework that is used for face matching, recognition and liveness detection.
|
|
3
3
|
This plugin makes possible to use it with react-native, cordova and ionic applications.
|
|
4
4
|
|
|
5
|
-
# Contents
|
|
6
|
-
* [Demo applications](#demo-applications)
|
|
7
|
-
* [Documentation](#documentation)
|
|
8
|
-
* [Additional information](#additional-information)
|
|
9
|
-
|
|
10
5
|
## Demo applications
|
|
11
6
|
In the [examples](examples/) folder you can find demo 4 applications:
|
|
12
7
|
* [React-native](examples/react-native)
|
|
@@ -19,5 +14,5 @@ Each demo app has its own readme file with instructions on building and installa
|
|
|
19
14
|
## Documentation
|
|
20
15
|
You can find documentation on API [here](https://docs.regulaforensics.com/develop/face-sdk/mobile).
|
|
21
16
|
|
|
22
|
-
##
|
|
17
|
+
## Support
|
|
23
18
|
If you have any technical questions, feel free to [contact](mailto:support@regulaforensics.com) us or create issues [here](https://github.com/regulaforensics/npm-face-sdk/issues).
|
|
@@ -633,7 +633,7 @@ fun generateDetectFacesConfig(input: DetectFacesConfiguration?) = input?.let {
|
|
|
633
633
|
fun detectFacesRequestFromJSON(input: JSONObject) = input.let {
|
|
634
634
|
val image = it.getString("image").toBitmap()!!
|
|
635
635
|
it.getStringOrNull("scenario")?.let { scenario ->
|
|
636
|
-
DetectFacesRequest::class.
|
|
636
|
+
DetectFacesRequest::class.java.getDeclaredConstructor(Bitmap::class.java, String::class.java).instantiate(image, scenario)
|
|
637
637
|
} ?: DetectFacesRequest(
|
|
638
638
|
image,
|
|
639
639
|
detectFacesConfigFromJSON(it.getJSONObjectOrNull("configuration")),
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
$ npm install
|
|
12
|
-
```
|
|
1
|
+
# Regula Face SDK Capacitor demo application
|
|
2
|
+
|
|
3
|
+
## How to build demo application
|
|
4
|
+
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
|
+
|
|
6
|
+
2. Run `npm run setup` within this directory.
|
|
7
|
+
|
|
8
|
+
3. Run the app:
|
|
9
|
+
* Android: use command `ionic cap run android`.
|
|
10
|
+
* IOS: use command `ionic cap run ios`.
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
* Run `npx jetify`, then `ionic cap run android` - this is just one way to run the app. You can also run it directly from within Android Studio.
|
|
12
|
+
**Note**: this is just one way of running the app. You can also run it directly from Xcode and Android Studio, but in this case make sure to run `ionic cap sync` before building if any changes were make to the project.
|
|
16
13
|
|
|
17
|
-
9. iOS:
|
|
18
|
-
* Run `ionic cap run ios` - this is just one way to run the app. You can also run it directly from within Xcode.
|
|
19
14
|
|
|
15
|
+
## How to use offine match
|
|
16
|
+
1. Place a license that supports offline match at `public/assets/regula.license`.
|
|
17
|
+
|
|
18
|
+
2. Change android and iOS bundle id if required by your license(replace `ANDROID_ID` and `IOS_ID` with actual ids):
|
|
19
|
+
* Change `applicationId` to `ANDROID_ID` in `android/app/build.gradle`.
|
|
20
|
+
* Change `Bundle Identifier` to `IOS_ID` in `ios/App/App.xcodeproj` in the `Signing & Capabilities` section.
|
|
21
|
+
|
|
22
|
+
3. Change core with the following commands:
|
|
23
|
+
```bash
|
|
24
|
+
npm uninstall @regulaforensics/face-core-basic
|
|
25
|
+
npm install @regulaforensics/face-core-match
|
|
26
|
+
ionic cap sync
|
|
27
|
+
```
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
If you have issues with license verification when running the application, please verify that next is true:
|
|
23
|
-
1. The OS, which you use, is specified in the license (e.g., Android and/or iOS).
|
|
24
|
-
3. The license is valid (not expired).
|
|
25
|
-
4. The date and time on the device, where you run the application, are valid.
|
|
26
|
-
5. You use the latest release version of the Document Reader SDK.
|
|
27
|
-
6. You placed the `license` into the correct folder as described [here](#how-to-build-demo-application).
|
|
29
|
+
4. Turn off the internet and run the app.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"lint": "eslint"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@regulaforensics/face-sdk": "6.3.
|
|
18
|
+
"@regulaforensics/face-sdk": "6.3.72-beta",
|
|
19
19
|
"@regulaforensics/face-core-basic": "6.3.12-beta",
|
|
20
20
|
"@awesome-cordova-plugins/camera": "6.6.0",
|
|
21
21
|
"@awesome-cordova-plugins/file": "6.6.0",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Regula Face SDK Cordova demo application
|
|
2
|
+
|
|
3
|
+
## How to build demo application
|
|
4
|
+
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
|
+
|
|
6
|
+
2. Run `npm run setup` within this directory.
|
|
7
|
+
|
|
8
|
+
3. Run the app:
|
|
9
|
+
* Android: use command `npm run android`.
|
|
10
|
+
* IOS: use command `npm run ios`.
|
|
11
|
+
|
|
12
|
+
**Note**: this is just one way of running the app. You can also run it directly from Xcode and Android Studio, but in this case make sure to run `cordova prepare ios` and `cordova prepare android` before building if any changes were make to the project.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## How to use offine match
|
|
16
|
+
1. Place a license that supports offline match at `www/regula.license`.
|
|
17
|
+
|
|
18
|
+
2. Change `android-packageName` and `ios-CFBundleIdentifier` in `config.xml` if required by your license.
|
|
19
|
+
|
|
20
|
+
3. Change core with the following commands:
|
|
21
|
+
```bash
|
|
22
|
+
cordova plugin remove @regulaforensics/face-core-basic
|
|
23
|
+
cordova plugin add @regulaforensics/face-core-match
|
|
24
|
+
cordova prepare
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
4. Turn off the internet and run the app.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Regula Forensics Inc.",
|
|
15
15
|
"license": "commercial",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@regulaforensics/face-sdk": "6.3.
|
|
17
|
+
"@regulaforensics/face-sdk": "6.3.72-beta",
|
|
18
18
|
"@regulaforensics/face-core-basic": "6.3.12-beta",
|
|
19
19
|
"cordova-android": "12.0.1",
|
|
20
20
|
"cordova-ios": "7.0.1",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Regula Face SDK Ionic demo application
|
|
2
|
+
|
|
3
|
+
## How to build demo application
|
|
4
|
+
1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-face-sdk.git`.
|
|
5
|
+
|
|
6
|
+
2. Run `npm run setup` within this directory.
|
|
7
|
+
|
|
8
|
+
3. Run the app:
|
|
9
|
+
* Android: use command `npm run android`.
|
|
10
|
+
* IOS: use command `npm run ios`.
|
|
11
|
+
|
|
12
|
+
**Note**: this is just one way of running the app. You can also run it directly from Xcode and Android Studio, but in this case make sure to run `ionic cordova prepare ios` and `ionic cordova prepare android` before building if any changes were make to the project.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## How to use offine match
|
|
16
|
+
1. Place a license that supports offline match at `src/assets/regula.license`.
|
|
17
|
+
|
|
18
|
+
2. Change `android-packageName` and `ios-CFBundleIdentifier` in `config.xml` if required by your license.
|
|
19
|
+
|
|
20
|
+
3. Change core with the following commands:
|
|
21
|
+
```bash
|
|
22
|
+
ionic cordova plugin remove @regulaforensics/face-core-basic
|
|
23
|
+
ionic cordova plugin add @regulaforensics/face-core-match
|
|
24
|
+
ionic cordova prepare
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
4. Turn off the internet and run the app.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"private": true,
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@regulaforensics/face-sdk": "6.3.
|
|
19
|
+
"@regulaforensics/face-sdk": "6.3.72-beta",
|
|
20
20
|
"@regulaforensics/face-core-basic": "6.3.12-beta",
|
|
21
21
|
"cordova-plugin-camera": "7.0.0",
|
|
22
22
|
"@awesome-cordova-plugins/camera": "6.6.0",
|
|
@@ -23,8 +23,8 @@ npx react-native-rename@latest "FaceSDK" --androidBundleID "ANDROID_ID" --iosBun
|
|
|
23
23
|
|
|
24
24
|
3. Change core with the following commands:
|
|
25
25
|
```bash
|
|
26
|
-
npm uninstall @regulaforensics/
|
|
27
|
-
npm install @regulaforensics/
|
|
26
|
+
npm uninstall @regulaforensics/face-core-basic
|
|
27
|
+
npm install @regulaforensics/face-core-match
|
|
28
28
|
npm run setup
|
|
29
29
|
```
|
|
30
30
|
|
package/ios/CVDFaceSDK.m
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
#import "CVDFaceSDK.h"
|
|
2
2
|
|
|
3
|
-
CVDFaceSDK* RFSWPlugin;
|
|
4
3
|
@implementation CVDFaceSDK
|
|
5
4
|
|
|
6
|
-
NSMutableDictionary<NSString*, NSString*>*
|
|
5
|
+
static NSMutableDictionary<NSString*, NSString*>* _eventCallbackIds = nil;
|
|
7
6
|
- (NSMutableDictionary<NSString*, NSString*>*)eventCallbackIds {
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
7
|
+
if (_eventCallbackIds == nil) _eventCallbackIds = @{}.mutableCopy;
|
|
8
|
+
return _eventCallbackIds;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
- (void) exec:(CDVInvokedUrlCommand*)command {
|
|
13
|
-
RFSWPlugin = self;
|
|
14
12
|
NSString* method = command.arguments[0];
|
|
15
13
|
NSMutableArray* args = [NSMutableArray new];
|
|
16
14
|
for (int i = 1; i < command.arguments.count; i++) [args addObject:command.arguments[i]];
|
|
@@ -20,12 +18,12 @@ NSMutableDictionary<NSString*, NSString*>* _RFSWEventCallbackIds = nil;
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
RFSWEventSender sendEvent = ^(NSString* callbackId, id data) {
|
|
23
|
-
NSString* eventId = [
|
|
21
|
+
NSString* eventId = [self.eventCallbackIds objectForKey:callbackId];
|
|
24
22
|
if(eventId) callbackId = eventId;
|
|
25
23
|
data = [RFSWJSONConstructor toSendable:data];
|
|
26
24
|
CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:data];
|
|
27
25
|
[result setKeepCallbackAsBool:YES];
|
|
28
|
-
[
|
|
26
|
+
[self.commandDelegate sendPluginResult:result callbackId:callbackId];
|
|
29
27
|
};
|
|
30
28
|
|
|
31
29
|
[RFSWMain methodCall:method :args :^(id data) { sendEvent(command.callbackId, data); } :sendEvent];
|
package/ios/RFSWConfig.m
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
@"closeButtonEnabled": ^{ [builder setCloseButtonEnabled:[value boolValue]]; },
|
|
14
14
|
@"torchButtonEnabled": ^{ [builder setTorchButtonEnabled:[value boolValue]]; },
|
|
15
15
|
@"vibrateOnSteps": ^{ [builder setVibrateOnSteps:[value boolValue]]; },
|
|
16
|
+
@"detectOcclusion": ^{ [builder setDetectOcclusion:[value boolValue]]; },
|
|
16
17
|
@"cameraPositionIOS": ^{ [builder setCameraPosition:[value integerValue]]; },
|
|
17
18
|
@"timeout": ^{ [builder setTimeoutInterval:value]; },
|
|
18
19
|
@"holdStillDuration": ^{ [builder setHoldStillDuration:value]; },
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
@"closeButtonEnabled":@(input.closeButtonEnabled),
|
|
30
31
|
@"torchButtonEnabled":@(input.torchButtonEnabled),
|
|
31
32
|
@"vibrateOnSteps":@(input.vibrateOnSteps),
|
|
33
|
+
@"detectOcclusion":@(input.detectOcclusion),
|
|
32
34
|
@"cameraPositionIOS":@(input.cameraPosition),
|
|
33
35
|
}.mutableCopy;
|
|
34
36
|
if (input.timeoutInterval) result[@"timeout"] = input.timeoutInterval;
|
|
@@ -87,6 +89,7 @@
|
|
|
87
89
|
id value = input[key];
|
|
88
90
|
NSDictionary* Switch = @{
|
|
89
91
|
@"processingMode": ^{ [builder setProcessingMode:[value integerValue]]; },
|
|
92
|
+
@"locationTrackingEnabled": ^{ [builder setLocationTrackingEnabled:[value boolValue]]; },
|
|
90
93
|
};
|
|
91
94
|
if(Switch[key]) ((void(^)(void))Switch[key])();
|
|
92
95
|
}
|
|
@@ -96,6 +99,7 @@
|
|
|
96
99
|
+(id)generateMatchFacesConfig:(RFSMatchFacesConfiguration*)input {
|
|
97
100
|
return @{
|
|
98
101
|
@"processingMode":@(input.processingMode),
|
|
102
|
+
@"locationTrackingEnabled":@(input.locationTrackingEnabled),
|
|
99
103
|
};
|
|
100
104
|
}
|
|
101
105
|
|
package/ios/RFSWMain.h
CHANGED
|
@@ -17,7 +17,7 @@ typedef void (^RFSWEventSender)(NSString* _Nonnull event, id _Nullable data);
|
|
|
17
17
|
|
|
18
18
|
@end
|
|
19
19
|
|
|
20
|
-
static NSString* _Nonnull
|
|
21
|
-
static NSString* _Nonnull
|
|
22
|
-
static NSString* _Nonnull
|
|
23
|
-
static NSString* _Nonnull
|
|
20
|
+
static NSString* _Nonnull cameraSwitchEvent = @"cameraSwitchEvent";
|
|
21
|
+
static NSString* _Nonnull livenessNotificationEvent = @"livenessNotificationEvent";
|
|
22
|
+
static NSString* _Nonnull videoEncoderCompletionEvent = @"video_encoder_completion";
|
|
23
|
+
static NSString* _Nonnull onCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
|
package/ios/RFSWMain.m
CHANGED
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
@implementation RFSWMain
|
|
4
4
|
|
|
5
|
-
RFSWMain* RFSWSelf;
|
|
6
|
-
RFSWEventSender RFSWSendEvent;
|
|
7
|
-
|
|
8
|
-
NSDictionary* RFSWheaders;
|
|
9
|
-
|
|
10
5
|
+(void)methodCall:(NSString*)method :(NSArray*)args :(RFSWCallback)callback :(RFSWEventSender)eventSender {
|
|
11
|
-
if(!
|
|
12
|
-
|
|
6
|
+
if(!this) this = [RFSWMain new];
|
|
7
|
+
sendEvent = eventSender;
|
|
13
8
|
NSDictionary* Switch = @{
|
|
14
9
|
@"getVersion": ^{ [self getVersion :callback]; },
|
|
15
10
|
@"getServiceUrl": ^{ [self getServiceUrl :callback]; },
|
|
@@ -52,6 +47,18 @@ NSDictionary* RFSWheaders;
|
|
|
52
47
|
((void(^)(void))Switch[method])();
|
|
53
48
|
}
|
|
54
49
|
|
|
50
|
+
static RFSWMain* this;
|
|
51
|
+
static RFSWEventSender sendEvent;
|
|
52
|
+
|
|
53
|
+
static NSDictionary* headers;
|
|
54
|
+
|
|
55
|
+
static UIViewController*(^rootViewController)(void) = ^UIViewController*(){
|
|
56
|
+
for (UIWindow *window in UIApplication.sharedApplication.windows)
|
|
57
|
+
if (window.isKeyWindow)
|
|
58
|
+
return window.rootViewController;
|
|
59
|
+
return nil;
|
|
60
|
+
};
|
|
61
|
+
|
|
55
62
|
+(void)getVersion:(RFSWCallback)callback {
|
|
56
63
|
callback([RFSWJSONConstructor generateFaceSDKVersion:RFSFaceSDK.service.version]);
|
|
57
64
|
}
|
|
@@ -73,14 +80,14 @@ NSDictionary* RFSWheaders;
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
+(void)setRequestHeaders:(NSDictionary*)headersDict {
|
|
76
|
-
|
|
77
|
-
RFSFaceSDK.service.requestInterceptingDelegate =
|
|
83
|
+
headers = headersDict;
|
|
84
|
+
RFSFaceSDK.service.requestInterceptingDelegate = this;
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
-(NSURLRequest*)interceptorPrepareRequest:(NSURLRequest*)request {
|
|
81
88
|
NSMutableURLRequest *interceptedRequest = [request mutableCopy];
|
|
82
|
-
for (NSString* key in
|
|
83
|
-
[interceptedRequest addValue:[
|
|
89
|
+
for (NSString* key in headers.allKeys)
|
|
90
|
+
[interceptedRequest addValue:[headers valueForKey:key] forHTTPHeaderField:key];
|
|
84
91
|
return interceptedRequest;
|
|
85
92
|
}
|
|
86
93
|
|
|
@@ -103,7 +110,7 @@ NSDictionary* RFSWheaders;
|
|
|
103
110
|
|
|
104
111
|
+(void)startFaceCapture:(NSDictionary*)config :(RFSWCallback)callback {
|
|
105
112
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
106
|
-
[RFSFaceSDK.service presentFaceCaptureViewControllerFrom:
|
|
113
|
+
[RFSFaceSDK.service presentFaceCaptureViewControllerFrom:rootViewController()
|
|
107
114
|
animated:true
|
|
108
115
|
configuration:[RFSWConfig faceCaptureConfigFromJSON:config]
|
|
109
116
|
onCapture:[self faceCaptureCompletion:callback]
|
|
@@ -117,7 +124,7 @@ NSDictionary* RFSWheaders;
|
|
|
117
124
|
|
|
118
125
|
+(void)startLiveness:(NSDictionary*)config :(RFSWCallback)callback {
|
|
119
126
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
120
|
-
[RFSFaceSDK.service startLivenessFrom:
|
|
127
|
+
[RFSFaceSDK.service startLivenessFrom:rootViewController()
|
|
121
128
|
animated:true
|
|
122
129
|
configuration:[RFSWConfig livenessConfigFromJSON:config]
|
|
123
130
|
onLiveness:[self livenessCompletion:callback]
|
|
@@ -275,10 +282,10 @@ NSDictionary* RFSWheaders;
|
|
|
275
282
|
+(RFSInitializationCompletion)initCompletion:(RFSWCallback)callback {
|
|
276
283
|
return ^(BOOL success, NSError* error) {
|
|
277
284
|
RFSFaceSDK.service.customization.configuration = [RFSUIConfiguration defaultConfiguration];
|
|
278
|
-
[RFSFaceSDK.service setVideoUploadingDelegate:
|
|
279
|
-
[RFSFaceSDK.service setFaceCaptureDelegate:
|
|
280
|
-
[RFSFaceSDK.service setLivenessDelegate:
|
|
281
|
-
RFSFaceSDK.service.customization.actionDelegate =
|
|
285
|
+
[RFSFaceSDK.service setVideoUploadingDelegate:this];
|
|
286
|
+
[RFSFaceSDK.service setFaceCaptureDelegate:this];
|
|
287
|
+
[RFSFaceSDK.service setLivenessDelegate:this];
|
|
288
|
+
RFSFaceSDK.service.customization.actionDelegate = this;
|
|
282
289
|
callback([RFSWJSONConstructor generateInitCompletion:success :error]);
|
|
283
290
|
};
|
|
284
291
|
}
|
|
@@ -331,22 +338,22 @@ NSDictionary* RFSWheaders;
|
|
|
331
338
|
|
|
332
339
|
// RFSFaceCaptureDelegate & RFSLivenessDelegate
|
|
333
340
|
-(void)cameraPositionChanged:(RFSCameraPosition)cameraPosition {
|
|
334
|
-
|
|
341
|
+
sendEvent(cameraSwitchEvent, @(cameraPosition));
|
|
335
342
|
}
|
|
336
343
|
|
|
337
344
|
// RFSLivenessDelegate
|
|
338
345
|
-(void)processStatusChanged:(RFSLivenessProcessStatus)status result:(RFSLivenessResponse*)result {
|
|
339
|
-
|
|
346
|
+
sendEvent(livenessNotificationEvent, [RFSWJSONConstructor generateLivenessNotification:status result:result]);
|
|
340
347
|
}
|
|
341
348
|
|
|
342
349
|
// RFSVideoUploadingDelegate
|
|
343
350
|
-(void)videoUploadingForTransactionId:(NSString*)transactionId didFinishedWithSuccess:(BOOL)success {
|
|
344
|
-
|
|
351
|
+
sendEvent(videoEncoderCompletionEvent, [RFSWJSONConstructor generateVideoEncoderCompletion:transactionId :success]);
|
|
345
352
|
}
|
|
346
353
|
|
|
347
354
|
// RFSCustomizationActionDelegate
|
|
348
355
|
-(void)onFaceCustomButtonTappedWithTag:(NSInteger)tag {
|
|
349
|
-
|
|
356
|
+
sendEvent(onCustomButtonTappedEvent, @(tag));
|
|
350
357
|
}
|
|
351
358
|
|
|
352
359
|
@end
|
package/ios/RNFaceSDK.h
CHANGED
package/ios/RNFaceSDK.m
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
#import "RNFaceSDK.h"
|
|
2
2
|
|
|
3
|
-
RNFaceSDK* RFSWPlugin;
|
|
4
3
|
@implementation RNFaceSDK
|
|
5
4
|
RCT_EXPORT_MODULE();
|
|
6
5
|
|
|
7
|
-
NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
|
|
6
|
+
static NSMutableArray<RCTResponseSenderBlock>* _firedCallbacks = nil;
|
|
8
7
|
- (NSMutableArray<RCTResponseSenderBlock>*)firedCallbacks {
|
|
9
8
|
if (_firedCallbacks == nil) _firedCallbacks = @[].mutableCopy;
|
|
10
9
|
return _firedCallbacks;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
- (NSArray<NSString*>*)supportedEvents {
|
|
14
|
-
return @[
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
return @[cameraSwitchEvent,
|
|
14
|
+
livenessNotificationEvent,
|
|
15
|
+
videoEncoderCompletionEvent,
|
|
16
|
+
onCustomButtonTappedEvent];
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
bool hasListeners;
|
|
19
|
+
static bool hasListeners;
|
|
21
20
|
- (void)startObserving { hasListeners = YES; }
|
|
22
21
|
- (void)stopObserving { hasListeners = NO; }
|
|
23
22
|
|
|
24
23
|
RCT_EXPORT_METHOD(exec:(NSString*)method:(NSArray*)args:(RCTPromiseResolveBlock)resolve:(RCTPromiseRejectBlock)reject) {
|
|
25
|
-
RFSWPlugin = self;
|
|
26
|
-
|
|
27
24
|
RFSWCallback callback = ^(id _Nullable data) {
|
|
28
25
|
if ([self.firedCallbacks containsObject:resolve]) return;
|
|
29
26
|
[self.firedCallbacks addObject:resolve];
|
|
@@ -32,7 +29,7 @@ RCT_EXPORT_METHOD(exec:(NSString*)method:(NSArray*)args:(RCTPromiseResolveBlock)
|
|
|
32
29
|
|
|
33
30
|
RFSWEventSender sendEvent = ^(NSString* event, id data) {
|
|
34
31
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
35
|
-
if (hasListeners) [
|
|
32
|
+
if (hasListeners) [self sendEventWithName:event body:[RFSWJSONConstructor toSendable:data]];
|
|
36
33
|
});
|
|
37
34
|
};
|
|
38
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/face-sdk",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.72-beta",
|
|
4
4
|
"description": "This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/face-sdk" version="6.3.
|
|
2
|
+
<plugin id="@regulaforensics/face-sdk" version="6.3.72-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>FaceSDK</name>
|
|
4
4
|
<description>Cordova plugin for Regula Face SDK</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export class Font {
|
|
2
2
|
name
|
|
3
|
-
style
|
|
4
3
|
size
|
|
4
|
+
style
|
|
5
|
+
|
|
6
|
+
constructor(name, params) {
|
|
7
|
+
this.name = name
|
|
8
|
+
this.size = params?.size
|
|
9
|
+
this.style = params?.style
|
|
10
|
+
}
|
|
5
11
|
|
|
6
12
|
static fromJson(jsonObject) {
|
|
7
13
|
if (jsonObject == null) return null
|
|
8
14
|
const result = new Font()
|
|
9
15
|
|
|
10
16
|
result.name = jsonObject["name"]
|
|
11
|
-
result.style = jsonObject["style"]
|
|
12
17
|
result.size = jsonObject["size"]
|
|
18
|
+
result.style = jsonObject["style"]
|
|
13
19
|
|
|
14
20
|
return result
|
|
15
21
|
}
|
|
@@ -20,4 +26,4 @@ export const FontStyle = {
|
|
|
20
26
|
BOLD: 1,
|
|
21
27
|
ITALIC: 2,
|
|
22
28
|
BOLD_ITALIC: 3,
|
|
23
|
-
}
|
|
29
|
+
}
|
package/www/cordova.js
CHANGED
|
@@ -628,16 +628,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
628
628
|
/* harmony export */ });
|
|
629
629
|
class Font {
|
|
630
630
|
name
|
|
631
|
-
style
|
|
632
631
|
size
|
|
632
|
+
style
|
|
633
|
+
|
|
634
|
+
constructor(name, params) {
|
|
635
|
+
this.name = name
|
|
636
|
+
this.size = params?.size
|
|
637
|
+
this.style = params?.style
|
|
638
|
+
}
|
|
633
639
|
|
|
634
640
|
static fromJson(jsonObject) {
|
|
635
641
|
if (jsonObject == null) return null
|
|
636
642
|
const result = new Font()
|
|
637
643
|
|
|
638
644
|
result.name = jsonObject["name"]
|
|
639
|
-
result.style = jsonObject["style"]
|
|
640
645
|
result.size = jsonObject["size"]
|
|
646
|
+
result.style = jsonObject["style"]
|
|
641
647
|
|
|
642
648
|
return result
|
|
643
649
|
}
|
|
@@ -650,6 +656,7 @@ const FontStyle = {
|
|
|
650
656
|
BOLD_ITALIC: 3,
|
|
651
657
|
}
|
|
652
658
|
|
|
659
|
+
|
|
653
660
|
/***/ }),
|
|
654
661
|
|
|
655
662
|
/***/ "./src/customization/screen_orientation.js":
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export class Font {
|
|
2
2
|
name
|
|
3
|
-
style
|
|
4
3
|
size
|
|
4
|
+
style
|
|
5
|
+
|
|
6
|
+
constructor(name, params) {
|
|
7
|
+
this.name = name
|
|
8
|
+
this.size = params?.size
|
|
9
|
+
this.style = params?.style
|
|
10
|
+
}
|
|
5
11
|
|
|
6
12
|
static fromJson(jsonObject) {
|
|
7
13
|
if (jsonObject == null) return null
|
|
8
14
|
const result = new Font()
|
|
9
15
|
|
|
10
16
|
result.name = jsonObject["name"]
|
|
11
|
-
result.style = jsonObject["style"]
|
|
12
17
|
result.size = jsonObject["size"]
|
|
18
|
+
result.style = jsonObject["style"]
|
|
13
19
|
|
|
14
20
|
return result
|
|
15
21
|
}
|
|
@@ -20,4 +26,4 @@ export const FontStyle = {
|
|
|
20
26
|
BOLD: 1,
|
|
21
27
|
ITALIC: 2,
|
|
22
28
|
BOLD_ITALIC: 3,
|
|
23
|
-
}
|
|
29
|
+
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export class Font {
|
|
2
|
-
name
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
get name(): string
|
|
3
|
+
get size(): number | null
|
|
4
|
+
get style(): FontStyle | null
|
|
5
|
+
|
|
6
|
+
constructor(
|
|
7
|
+
name: string,
|
|
8
|
+
params?: {
|
|
9
|
+
size?: number,
|
|
10
|
+
style?: FontStyle
|
|
11
|
+
}
|
|
12
|
+
)
|
|
5
13
|
|
|
6
14
|
static fromJson(jsonObject?: any): Font | null
|
|
7
15
|
}
|
|
@@ -11,4 +19,4 @@ export enum FontStyle {
|
|
|
11
19
|
BOLD,
|
|
12
20
|
ITALIC,
|
|
13
21
|
BOLD_ITALIC,
|
|
14
|
-
}
|
|
22
|
+
}
|