@yeomessagingcom/react-native-yeofr 0.1.10 → 0.1.11

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
@@ -6,7 +6,4 @@ export const createTracker = (): Promise<number> => YEOFRModule.createTracker();
6
6
  export const freeTracker = (): Promise<number> => YEOFRModule.freeTracker();
7
7
  export const getTrackerData = (): Promise<string> => YEOFRModule.getTrackerData();
8
8
  export const loadTracker = (base64: string): Promise<number> => YEOFRModule.loadTracker(base64);
9
- export const enroll = (faceID: number, name: string): Promise<number> => YEOFRModule.enroll(faceID, name);
10
- export const processFrameBase64 = (args: {
11
- base64ARGB: string; width: number; height: number; stride: number; ratio?: number; needFaceRect?: boolean;
12
- }) => YEOFRModule.processFrameBase64(args.base64ARGB, args.width, args.height, args.stride, args.ratio ?? 1, !!args.needFaceRect);
9
+ export const enroll = (faceID: number, name: string): Promise<number> => YEOFRModule.enroll(faceID, name);
package/ios/YEOFRModule.m CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  RCT_EXTERN_METHOD(getVersion:(RCTPromiseResolveBlock)resolve
6
6
  rejecter:(RCTPromiseRejectBlock)reject)
7
-
7
+
8
8
  RCT_EXTERN_METHOD(createTracker:(RCTPromiseResolveBlock)resolve
9
9
  rejecter:(RCTPromiseRejectBlock)reject)
10
10
 
@@ -27,13 +27,4 @@ RCT_EXTERN_METHOD(enroll:(nonnull NSNumber *)faceID
27
27
  resolver:(RCTPromiseResolveBlock)resolve
28
28
  rejecter:(RCTPromiseRejectBlock)reject)
29
29
 
30
- RCT_EXTERN_METHOD(processFrameBase64:(NSString *)base64ARGB
31
- width:(nonnull NSNumber *)width
32
- height:(nonnull NSNumber *)height
33
- stride:(nonnull NSNumber *)stride
34
- ratio:(nonnull NSNumber *)ratio
35
- needFaceRect:(BOOL)needFaceRect
36
- resolver:(RCTPromiseResolveBlock)resolve
37
- rejecter:(RCTPromiseRejectBlock)reject)
38
-
39
30
  @end
@@ -1,5 +1,6 @@
1
1
  import Foundation
2
- import YEOFRSDK // from your xcframework
2
+ import React
3
+ import YEOFR // from your xcframework
3
4
 
4
5
  @objc(YEOFRModule)
5
6
  class YEOFRModule: NSObject {
@@ -52,40 +53,4 @@ class YEOFRModule: NSObject {
52
53
  let rc = sdk.enroll(faceID: faceID.int64Value, name: name, learnFromCurrentFrame: true)
53
54
  rc == .OK ? resolve(rc.rawValue) : reject("rc", "enroll failed: \(rc.rawValue)", nil)
54
55
  }
55
-
56
- // JS-only helper for quick smoke tests; production should feed frames via native iOS component.
57
- @objc func processFrameBase64(_ base64ARGB: String,
58
- width: NSNumber,
59
- height: NSNumber,
60
- stride: NSNumber,
61
- ratio: NSNumber,
62
- needFaceRect: Bool,
63
- resolver resolve: RCTPromiseResolveBlock,
64
- rejecter reject: RCTPromiseRejectBlock) {
65
- guard let bytes = Data(base64Encoded: base64ARGB) else {
66
- return reject("bad_input", "invalid base64", nil)
67
- }
68
- let count = bytes.count
69
- let ptr = UnsafeMutablePointer<UInt8>.allocate(capacity: count)
70
- _ = bytes.copyBytes(to: ptr, count: count)
71
-
72
- let params = ImageFrameParameters(buffer: ptr,
73
- width: width.intValue,
74
- height: height.intValue,
75
- scanLine: stride.intValue,
76
- ratio: ratio.floatValue)
77
- let result = sdk.detectFaces(params: params, needFaceRect: needFaceRect)
78
-
79
- var faces: [[String: Any]] = []
80
- if let rects = result.faceRects, let ids = result.faceIDs {
81
- for (id, rect) in rects {
82
- faces.append([
83
- "id": id,
84
- "name": ids[id] ?? NSNull(),
85
- "rect": ["x": rect.origin.x, "y": rect.origin.y, "w": rect.size.width, "h": rect.size.height]
86
- ])
87
- }
88
- }
89
- resolve(["state": result.faceState.rawValue, "count": result.detectedCount, "faces": faces])
90
- }
91
56
  }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "react-native-yeofr"
3
- s.version = "0.1.10" # keep this in sync with your npm version
3
+ s.version = "0.1.11" # keep this in sync with your npm 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" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeomessagingcom/react-native-yeofr",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "React Native iOS integration for YEO Face Recognition (device-only).",
5
5
  "main": "index.ts",
6
6
  "react-native": "index.ts",
@@ -2,10 +2,9 @@ module.exports = {
2
2
  dependency: {
3
3
  platforms: {
4
4
  ios: {
5
- project: null,
6
- podspecPath: 'ios/react-native-yeofr.podspec'
5
+ podspecPath: 'ios/react-native-yeofr.podspec',
7
6
  },
8
- android: null
9
- }
10
- }
7
+ android: null,
8
+ },
9
+ },
11
10
  };