@yeomessagingcom/react-native-yeofr 0.1.24 → 0.1.26
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 +9 -2
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +87 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/yeofr/YeofrModule.kt +69 -0
- package/android/src/main/java/com/yeofr/YeofrPackage.kt +32 -0
- package/package.json +20 -4
- package/react-native.config.js +15 -6
package/README.md
CHANGED
|
@@ -4,32 +4,39 @@ iOS face recognition bridge for React Native (device-only).
|
|
|
4
4
|
**Build & run on a real device.** No simulator support.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
|
+
|
|
7
8
|
```bash
|
|
8
9
|
npm i @yeomessaging/react-native-yeofr
|
|
9
10
|
cd ios && pod install && cd ..
|
|
10
11
|
```
|
|
11
12
|
|
|
12
13
|
## Bumping npm module version:
|
|
14
|
+
|
|
13
15
|
1. update s.version in podspec with the new version number
|
|
14
16
|
2. update "version" in package.json with the new version number
|
|
15
17
|
|
|
16
18
|
if need to update SPM version that is used for framework asset:
|
|
19
|
+
|
|
17
20
|
1. update bin_ver in podspec
|
|
18
21
|
2. update sha256 with checksum from spm in podspec
|
|
19
22
|
|
|
20
23
|
## Publishing:
|
|
24
|
+
|
|
21
25
|
1. deprecate previous version (if required) (NB 0.1.11 is an example):
|
|
26
|
+
|
|
22
27
|
```bash
|
|
23
28
|
npm deprecate @yeomessagingcom/react-native-yeofr@0.1.11 "Deprecated"
|
|
24
29
|
```
|
|
25
30
|
|
|
26
31
|
2. tag with lastest version (NB 0.1.12 is an example - use the real next version of the nom module):
|
|
32
|
+
|
|
27
33
|
```bash
|
|
28
|
-
git tag 0.1.12
|
|
34
|
+
git tag 0.1.12
|
|
29
35
|
git push --tags
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
3. publish
|
|
39
|
+
|
|
33
40
|
```bash
|
|
34
41
|
npm publish --access public
|
|
35
|
-
```
|
|
42
|
+
```
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Yeofr_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
|
|
10
|
+
maven {
|
|
11
|
+
name = "Repsy"
|
|
12
|
+
url = uri("https://repo.repsy.io/mvn/samsonyeo/yeomessaging")
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
dependencies {
|
|
17
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
18
|
+
// noinspection DifferentKotlinGradleVersion
|
|
19
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
apply plugin: "com.android.library"
|
|
25
|
+
apply plugin: "kotlin-android"
|
|
26
|
+
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
|
+
|
|
29
|
+
def getExtOrIntegerDefault(name) {
|
|
30
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Yeofr_" + name]).toInteger()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
android {
|
|
34
|
+
namespace "com.yeofr"
|
|
35
|
+
|
|
36
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
37
|
+
|
|
38
|
+
defaultConfig {
|
|
39
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
40
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
buildFeatures {
|
|
44
|
+
buildConfig true
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
buildTypes {
|
|
48
|
+
release {
|
|
49
|
+
minifyEnabled false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lintOptions {
|
|
54
|
+
disable "GradleCompatible"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
compileOptions {
|
|
58
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
59
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sourceSets {
|
|
63
|
+
main {
|
|
64
|
+
java.srcDirs += [
|
|
65
|
+
"generated/java",
|
|
66
|
+
"generated/jni"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
repositories {
|
|
73
|
+
mavenCentral()
|
|
74
|
+
google()
|
|
75
|
+
maven {
|
|
76
|
+
name = "Repsy"
|
|
77
|
+
url = uri("https://repo.repsy.io/mvn/samsonyeo/yeomessaging")
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
82
|
+
|
|
83
|
+
dependencies {
|
|
84
|
+
implementation "com.facebook.react:react-android"
|
|
85
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
86
|
+
implementation "com.yeomessaging:yeofr-android:0.1.8"
|
|
87
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
package com.yeofr
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
+
import com.facebook.react.bridge.ReactMethod
|
|
7
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
8
|
+
import com.youreyeonly.yeofr.YEOFRSDK
|
|
9
|
+
import kotlin.io.encoding.Base64
|
|
10
|
+
import kotlin.io.encoding.ExperimentalEncodingApi
|
|
11
|
+
|
|
12
|
+
@ReactModule(name = YeofrModule.NAME)
|
|
13
|
+
class YeofrModule(reactContext: ReactApplicationContext) :
|
|
14
|
+
ReactContextBaseJavaModule(reactContext) {
|
|
15
|
+
|
|
16
|
+
override fun getName(): String {
|
|
17
|
+
return NAME
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@ReactMethod
|
|
21
|
+
fun getVersion(promise: Promise) {
|
|
22
|
+
promise.resolve(YEOFRSDK.version)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ReactMethod
|
|
26
|
+
fun createTracker(promise: Promise) {
|
|
27
|
+
promise.resolve(YEOFRSDK.createTracker())
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@ReactMethod
|
|
31
|
+
fun freeTracker(promise: Promise) {
|
|
32
|
+
promise.resolve(YEOFRSDK.freeTracker())
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@ReactMethod
|
|
36
|
+
fun clearTracker(promise: Promise) {
|
|
37
|
+
promise.resolve(YEOFRSDK.clearTracker())
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@OptIn(ExperimentalEncodingApi::class)
|
|
41
|
+
@ReactMethod
|
|
42
|
+
fun getTrackerData(promise: Promise) {
|
|
43
|
+
YEOFRSDK.faceRecognitionTrackerData()?.let { data ->
|
|
44
|
+
promise.resolve(Base64.encode(data))
|
|
45
|
+
} ?: run {
|
|
46
|
+
promise.reject("-1", "No tracker available!")
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@OptIn(ExperimentalEncodingApi::class)
|
|
51
|
+
@ReactMethod
|
|
52
|
+
fun loadTracker(base64String: String, promise: Promise) {
|
|
53
|
+
try {
|
|
54
|
+
val data = Base64.decode(base64String)
|
|
55
|
+
promise.resolve(YEOFRSDK.loadTracker(data))
|
|
56
|
+
} catch (e: Throwable) {
|
|
57
|
+
promise.reject(e)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@ReactMethod
|
|
62
|
+
fun enroll(faceID: Int, name: String, promise: Promise) {
|
|
63
|
+
promise.resolve(YEOFRSDK.enroll(faceID, name, true))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
companion object {
|
|
67
|
+
const val NAME = "YEOFRModule"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.yeofr
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
+
import java.util.HashMap
|
|
9
|
+
|
|
10
|
+
class YeofrPackage : BaseReactPackage() {
|
|
11
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
|
+
return when (name) {
|
|
13
|
+
YeofrModule.NAME -> YeofrModule(reactContext)
|
|
14
|
+
else -> null
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
19
|
+
return ReactModuleInfoProvider {
|
|
20
|
+
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
21
|
+
moduleInfos[YeofrModule.NAME] = ReactModuleInfo(
|
|
22
|
+
YeofrModule.NAME,
|
|
23
|
+
YeofrModule.NAME,
|
|
24
|
+
false, // canOverrideExistingModule
|
|
25
|
+
false, // needsEagerInit
|
|
26
|
+
false, // isCxxModule
|
|
27
|
+
false // isTurboModule
|
|
28
|
+
)
|
|
29
|
+
moduleInfos
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeomessagingcom/react-native-yeofr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "React Native iOS integration for YEO Face Recognition (device-only).",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"react-native": "index.ts",
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"index.ts",
|
|
20
20
|
"ios/**",
|
|
21
|
+
"android",
|
|
22
|
+
"!android/build",
|
|
23
|
+
"!android/gradle",
|
|
24
|
+
"!android/gradlew",
|
|
25
|
+
"!android/gradlew.bat",
|
|
26
|
+
"!android/local.properties",
|
|
21
27
|
"react-native.config.js",
|
|
22
28
|
"react-native-yeofr.podspec",
|
|
23
29
|
"README.md",
|
|
@@ -29,16 +35,26 @@
|
|
|
29
35
|
"keywords": [
|
|
30
36
|
"react-native",
|
|
31
37
|
"ios",
|
|
38
|
+
"android",
|
|
32
39
|
"face-recognition",
|
|
33
40
|
"yeofr"
|
|
34
41
|
],
|
|
35
42
|
"peerDependencies": {
|
|
36
|
-
"react-native": "
|
|
43
|
+
"react-native": "*"
|
|
37
44
|
},
|
|
38
45
|
"devDependencies": {
|
|
39
46
|
"@types/react-native": "^0.72.0"
|
|
40
47
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
48
|
+
"workspaces": [
|
|
49
|
+
"example"
|
|
50
|
+
],
|
|
51
|
+
"packageManager": "yarn@3.6.1",
|
|
52
|
+
"codegenConfig": {
|
|
53
|
+
"name": "ReactNativeYeofrSpec",
|
|
54
|
+
"type": "modules",
|
|
55
|
+
"jsSrcsDir": ".",
|
|
56
|
+
"android": {
|
|
57
|
+
"javaPackageName": "com.yeomessaging.reactnativeyeofr"
|
|
58
|
+
}
|
|
43
59
|
}
|
|
44
60
|
}
|
package/react-native.config.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const pkg = require("./package.json");
|
|
3
|
+
|
|
1
4
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
dependencies: {
|
|
6
|
+
[pkg.name]: {
|
|
7
|
+
name: pkg.name,
|
|
8
|
+
root: path.join(__dirname, ".."),
|
|
9
|
+
platforms: {
|
|
10
|
+
// Codegen script incorrectly fails without this
|
|
11
|
+
// So we explicitly specify the platforms with empty object
|
|
12
|
+
ios: {
|
|
13
|
+
podspecPath: "ios/react-native-yeofr.podspec",
|
|
14
|
+
},
|
|
15
|
+
android: {},
|
|
6
16
|
},
|
|
7
|
-
android: null,
|
|
8
17
|
},
|
|
9
18
|
},
|
|
10
|
-
};
|
|
19
|
+
};
|