@yeomessagingcom/react-native-yeofr 0.1.3 → 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/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { NativeModules } from 'react-native';
2
2
  const { YEOFRModule } = NativeModules as any;
3
3
 
4
+ export const getVersion = (): Promise<string> => YEOFRModule.getVersion();
4
5
  export const createTracker = (): Promise<number> => YEOFRModule.createTracker();
5
6
  export const freeTracker = (): Promise<number> => YEOFRModule.freeTracker();
6
7
  export const getTrackerData = (): Promise<string> => YEOFRModule.getTrackerData();
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
 
@@ -6,6 +6,11 @@ class YEOFRModule: NSObject {
6
6
  private let sdk = YEOFRSDK.shared
7
7
  @objc static func requiresMainQueueSetup() -> Bool { false }
8
8
 
9
+ @objc
10
+ func getVersion(_ resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) {
11
+ resolve(YEOFRSDK.version)
12
+ }
13
+
9
14
  @objc func createTracker(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
10
15
  let rc = sdk.createTracker()
11
16
  rc == .OK ? resolve(rc.rawValue) : reject("rc", "createTracker failed: \(rc.rawValue)", nil)
@@ -1,33 +1,41 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "react-native-yeofr"
3
- s.version = "0.1.3" # keep in lockstep with npm + SPM release tag
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" }
7
7
  s.author = { "YEO Messaging" => "luca@yeomessaging.com" }
8
- s.platform = :ios, "15.0"
8
+ s.platform = :ios, "15.1"
9
9
  s.swift_version = "5.9"
10
10
 
11
- # Only the RN shim files (bridges are inside your xcframework)
11
+ # Build the RN shim from local files
12
12
  s.source_files = "YEOFRModule.m", "YEOFRModule.swift"
13
13
 
14
- # Download the binary zip from your SPM repo release assets
15
- repo = "https://github.com/YEOMessaging/YEOFR-SPM"
16
- zip = "YEOFR.xcframework.zip"
17
- url = ENV['YEOFR_XCFRAMEWORK_URL'] || "#{repo}/releases/download/#{s.version}/#{zip}"
18
- s.source = { :http => url }
19
- # Optionally verify integrity:
20
- # s.source = { :http => url, :sha256 => "PUT_SHA256_HERE" }
14
+ # Download the binary xcframework (default to SPM 0.1.3; can override via env)
15
+ bin_ver = ENV['YEOFR_BINARY_VERSION'] || "0.1.3"
16
+ repo = "https://github.com/YEOMessaging/YEOFR-SPM"
17
+ asset = "YEOFR.xcframework.zip"
18
+ url = ENV['YEOFR_XCFRAMEWORK_URL'] || "#{repo}/releases/download/#{bin_ver}/#{asset}"
21
19
 
22
20
  s.prepare_command = <<-CMD
21
+ set -e
23
22
  rm -rf Vendor && mkdir -p Vendor
24
- unzip -o #{zip} -d Vendor >/dev/null
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
25
33
  CMD
26
34
 
27
35
  s.vendored_frameworks = "Vendor/YEOFR.xcframework"
28
36
  s.dependency "React-Core"
29
37
 
30
- # Device-only: exclude simulator archs
38
+ # Device-only
31
39
  s.pod_target_xcconfig = {
32
40
  'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64 arm64',
33
41
  'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeomessagingcom/react-native-yeofr",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "React Native iOS integration for YEO Face Recognition (device-only).",
5
5
  "main": "index.ts",
6
6
  "react-native": "index.ts",
@@ -8,10 +8,13 @@
8
8
  "author": "YEO Messaging",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/yeomessaging/react-native-yeofr.git"
11
+ "url": "git+https://github.com/yeomessaging/react-native-yeofr.git"
12
12
  },
13
13
  "homepage": "https://github.com/YEOMessaging/react-native-yeofr#readme",
14
- "bugs": { "email": "luca@yeomessaging.com", "url": "https://github.com/YEOMessaging/react-native-yeofr/issues" },
14
+ "bugs": {
15
+ "email": "luca@yeomessaging.com",
16
+ "url": "https://github.com/YEOMessaging/react-native-yeofr/issues"
17
+ },
15
18
  "files": [
16
19
  "index.ts",
17
20
  "ios",
@@ -19,11 +22,16 @@
19
22
  "README.md",
20
23
  "LICENSE"
21
24
  ],
22
- "keywords": ["react-native", "ios", "face-recognition", "yeofr"],
25
+ "keywords": [
26
+ "react-native",
27
+ "ios",
28
+ "face-recognition",
29
+ "yeofr"
30
+ ],
23
31
  "peerDependencies": {
24
- "react-native": ">=0.72.0"
25
- },
26
- "devDependencies": {
32
+ "react-native": ">=0.72.0"
33
+ },
34
+ "devDependencies": {
27
35
  "@types/react-native": "^0.72.0"
28
36
  }
29
- }
37
+ }