@yeomessagingcom/react-native-yeofr 0.1.4 → 0.1.5
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/ios/YEOFRModule.m +3 -0
- package/ios/YEOFRModule.swift +2 -1
- package/ios/react-native-yeofr.podspec +20 -14
- package/package.json +1 -1
package/ios/YEOFRModule.m
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
@interface RCT_EXTERN_MODULE(YEOFRModule, NSObject)
|
|
4
4
|
|
|
5
|
+
RCT_EXTERN_METHOD(getVersion:(RCTPromiseResolveBlock)resolve
|
|
6
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
7
|
+
|
|
5
8
|
RCT_EXTERN_METHOD(createTracker:(RCTPromiseResolveBlock)resolve
|
|
6
9
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
7
10
|
|
package/ios/YEOFRModule.swift
CHANGED
|
@@ -8,8 +8,9 @@ class YEOFRModule: NSObject {
|
|
|
8
8
|
|
|
9
9
|
@objc
|
|
10
10
|
func getVersion(_ resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) {
|
|
11
|
-
resolve(
|
|
11
|
+
resolve(YEOFRSDK.version)
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
@objc func createTracker(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
14
15
|
let rc = sdk.createTracker()
|
|
15
16
|
rc == .OK ? resolve(rc.rawValue) : reject("rc", "createTracker failed: \(rc.rawValue)", nil)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "react-native-yeofr"
|
|
3
|
-
s.version = "0.1.
|
|
3
|
+
s.version = "0.1.5" # npm package version
|
|
4
4
|
s.summary = "React Native iOS integration for YEO Face Recognition (device-only)."
|
|
5
5
|
s.homepage = "https://github.com/yeomessaging/react-native-yeofr"
|
|
6
6
|
s.license = { :type => "Commercial", :file => "../LICENSE" }
|
|
@@ -8,25 +8,31 @@ Pod::Spec.new do |s|
|
|
|
8
8
|
s.platform = :ios, "15.1"
|
|
9
9
|
s.swift_version = "5.9"
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Build the RN shim from local files
|
|
12
12
|
s.source_files = "YEOFRModule.m", "YEOFRModule.swift"
|
|
13
13
|
|
|
14
|
-
#
|
|
15
|
-
# Default the binary version to 0.1.3 (your SPM release),
|
|
16
|
-
# but allow override via env var YEOFR_BINARY_VERSION.
|
|
14
|
+
# Download the binary xcframework (default to SPM 0.1.3; can override via env)
|
|
17
15
|
bin_ver = ENV['YEOFR_BINARY_VERSION'] || "0.1.3"
|
|
18
16
|
repo = "https://github.com/YEOMessaging/YEOFR-SPM"
|
|
19
|
-
|
|
20
|
-
url = ENV['YEOFR_XCFRAMEWORK_URL'] || "#{repo}/releases/download/#{bin_ver}/#{
|
|
17
|
+
asset = "YEOFR.xcframework.zip"
|
|
18
|
+
url = ENV['YEOFR_XCFRAMEWORK_URL'] || "#{repo}/releases/download/#{bin_ver}/#{asset}"
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
s.prepare_command = <<-CMD
|
|
21
|
+
set -e
|
|
22
|
+
rm -rf Vendor && mkdir -p Vendor
|
|
23
|
+
echo "YEOFR: downloading #{url}"
|
|
24
|
+
if [ -n "$YEOFR_GITHUB_TOKEN" ]; then
|
|
25
|
+
curl -fL -H "Authorization: Bearer $YEOFR_GITHUB_TOKEN" -o "#{asset}" "#{url}"
|
|
26
|
+
else
|
|
27
|
+
curl -fL -o "#{asset}" "#{url}"
|
|
28
|
+
end
|
|
29
|
+
if [ -n "$YEOFR_SHA256" ]; then
|
|
30
|
+
echo "$YEOFR_SHA256 #{asset}" | shasum -a 256 -c -
|
|
31
|
+
fi
|
|
32
|
+
unzip -o "#{asset}" -d Vendor >/dev/null
|
|
33
|
+
CMD
|
|
29
34
|
|
|
35
|
+
s.vendored_frameworks = "Vendor/YEOFR.xcframework"
|
|
30
36
|
s.dependency "React-Core"
|
|
31
37
|
|
|
32
38
|
# Device-only
|