@thegrizzlylabs/react-native-genius-scan 5.0.0-beta6 → 5.0.0-beta8

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.
Files changed (25) hide show
  1. package/README.md +11 -2
  2. package/android/build.gradle +1 -1
  3. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK +0 -0
  4. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK-Swift.h +74 -23
  5. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Info.plist +0 -0
  6. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.abi.json +7668 -6709
  7. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +82 -32
  8. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  9. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftinterface +82 -32
  10. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
  11. package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/documentFinder.tflite +0 -0
  12. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK +0 -0
  13. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h +148 -46
  14. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Info.plist +0 -0
  15. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +7668 -6709
  16. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +82 -32
  17. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +82 -32
  19. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +7668 -6709
  20. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +82 -32
  21. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +82 -32
  23. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
  24. package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/documentFinder.tflite +0 -0
  25. package/package.json +1 -1
package/README.md CHANGED
@@ -42,7 +42,16 @@ $ react-native link @thegrizzlylabs/react-native-genius-scan
42
42
 
43
43
  ### Additional steps on Android
44
44
 
45
- - To your app `android/app/build.gradle`, change minSdkVersion to `21`.
45
+ - Open the `android/build.gradle` file, change `minSdkVersion` to `21` and add the following repository:
46
+
47
+ ```
48
+ allprojects {
49
+ repositories {
50
+ ...
51
+ maven { url 'https://s3.amazonaws.com/tgl.maven' }
52
+ }
53
+ }
54
+ ```
46
55
 
47
56
  ### Additional steps for iOS
48
57
 
@@ -52,7 +61,7 @@ NSCameraUsageDescription - "We use the camera for <provide a good reason why you
52
61
  ```
53
62
  - In your `Podfile`, add the following line:
54
63
  ```
55
- platform :ios, '11.0'
64
+ platform :ios, '13.0'
56
65
  ```
57
66
 
58
67
  Run `pod install` from the ios folder
@@ -41,5 +41,5 @@ rootProject.allprojects {
41
41
 
42
42
  dependencies {
43
43
  implementation 'com.facebook.react:react-native:+'
44
- implementation 'com.geniusscansdk:gssdk:5.0.0-beta6'
44
+ implementation 'com.geniusscansdk:gssdk:5.0.0-beta8'
45
45
  }
@@ -306,6 +306,19 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
306
306
 
307
307
 
308
308
 
309
+ /// The type of document detected by the document finder.
310
+ typedef SWIFT_ENUM(NSInteger, GSKDocumentFinderImageType, closed) {
311
+ /// No document present in the image
312
+ GSKDocumentFinderImageTypeNoDocument = 0,
313
+ /// A document present in the image, but no crop, perspective correction have been applied
314
+ GSKDocumentFinderImageTypeUnwarped = 1,
315
+ /// A document present in the image, and crop, perspective correction have been applied
316
+ GSKDocumentFinderImageTypeWarped = 2,
317
+ /// A document present in the image, crop/perspective correction and
318
+ /// enhanced have been applied.
319
+ GSKDocumentFinderImageTypeEnhanced = 3,
320
+ };
321
+
309
322
  @class GSKPDFDocument;
310
323
  @class GSKDocumentGeneratorConfiguration;
311
324
 
@@ -406,7 +419,7 @@ SWIFT_CLASS("_TtC5GSSDK12GSKOCRResult")
406
419
  @property (nonatomic, readonly, copy) NSString * _Nonnull text;
407
420
  /// The recognized text, as a structured text layout.
408
421
  @property (nonatomic, readonly, strong) GSKTextLayout * _Nonnull textLayout;
409
- - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout OBJC_DESIGNATED_INITIALIZER;
422
+ - (nonnull instancetype)initWithText:(NSString * _Nonnull)text textLayout:(GSKTextLayout * _Nonnull)textLayout;
410
423
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
411
424
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
412
425
  @end
@@ -629,6 +642,7 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
629
642
  @end
630
643
 
631
644
 
645
+
632
646
  @interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
633
647
  /// Create a configuration from a dictionary.
634
648
  /// This is particularly useful for interfacing with React Native but shouldn’t
@@ -637,7 +651,6 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
637
651
  @end
638
652
 
639
653
 
640
-
641
654
  /// Enum that defines various errors that can occur during a scan flow.
642
655
  typedef SWIFT_ENUM(NSInteger, GSKScanFlowError, open) {
643
656
  /// User has canceled the scan flow
@@ -770,29 +783,29 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowSource, open) {
770
783
  GSKScanFlowSourceLibrary = 2,
771
784
  };
772
785
 
773
- @class GSKScanFlowStructuredDataResultBankDetails;
774
- @class GSKScanFlowStructuredDataResultContact;
775
- @class GSKScanFlowStructuredDataResultReceipt;
786
+ @class GSKStructuredDataBankDetails;
787
+ @class GSKStructuredDataContact;
788
+ @class GSKStructuredDataReceipt;
776
789
 
777
790
  /// The result of a structured data extraction.
778
791
  SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
779
792
  @interface GSKScanFlowStructuredDataResult : NSObject
780
793
  /// Present if bank details extraction was requested, <code>nil</code> otherwise.
781
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultBankDetails * _Nullable bankDetails;
794
+ @property (nonatomic, strong) GSKStructuredDataBankDetails * _Nullable bankDetails;
782
795
  /// Present if business card contact extraction was requested and a contact was
783
796
  /// succcessfully extracted, <code>nil</code> otherwise.
784
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultContact * _Nullable businessCardContact;
797
+ @property (nonatomic, strong) GSKStructuredDataContact * _Nullable businessCardContact;
785
798
  /// Present if receipt extraction was requested and a receipt/invoice was
786
799
  /// succcessfully extracted, <code>nil</code> otherwise.
787
- @property (nonatomic, strong) GSKScanFlowStructuredDataResultReceipt * _Nullable receipt;
800
+ @property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
788
801
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
789
802
  @end
790
803
 
791
804
 
792
805
 
793
806
  /// Address data extracted from a business card document through OCR.
794
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
795
- @interface GSKScanFlowStructuredDataResultAddress : NSObject
807
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataAddress")
808
+ @interface GSKStructuredDataAddress : NSObject
796
809
  /// The city component of the address.
797
810
  @property (nonatomic, readonly, copy) NSString * _Nullable city;
798
811
  /// The postal/zip code component of the address.
@@ -810,30 +823,31 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultAddress")
810
823
 
811
824
 
812
825
  /// The bank details extracted from a document through OCR.
813
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultBankDetails")
814
- @interface GSKScanFlowStructuredDataResultBankDetails : NSObject
826
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataBankDetails")
827
+ @interface GSKStructuredDataBankDetails : NSObject
815
828
  /// The IBAN if successfully extracted, otherwise is <code>nil</code>.
816
829
  @property (nonatomic, copy) NSString * _Nullable iban;
817
830
  /// The BIC code if successfully extracted, otherwise is <code>nil</code>.
818
831
  @property (nonatomic, copy) NSString * _Nullable bic;
819
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
832
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
833
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
820
834
  @end
821
835
 
822
836
 
823
- @class GSKScanFlowStructuredDataResultPhoneNumber;
837
+ @class GSKStructuredDataPhoneNumber;
824
838
  @class CNContact;
825
839
 
826
840
  /// Contact data extracted from a business card document through OCR.
827
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
828
- @interface GSKScanFlowStructuredDataResultContact : NSObject
841
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataContact")
842
+ @interface GSKStructuredDataContact : NSObject
829
843
  /// Any name that appears on the business card. Contains the full name, including all components.
830
844
  @property (nonatomic, readonly, copy) NSString * _Nullable name;
831
845
  /// Any organization that appears on the business card.
832
846
  @property (nonatomic, readonly, copy) NSString * _Nullable organization;
833
847
  /// Any address that appears on the business card.
834
- @property (nonatomic, readonly, strong) GSKScanFlowStructuredDataResultAddress * _Nullable address;
848
+ @property (nonatomic, readonly, strong) GSKStructuredDataAddress * _Nullable address;
835
849
  /// The phone numbers that appear on the business card.
836
- @property (nonatomic, readonly, copy) NSArray<GSKScanFlowStructuredDataResultPhoneNumber *> * _Nonnull phoneNumbers;
850
+ @property (nonatomic, readonly, copy) NSArray<GSKStructuredDataPhoneNumber *> * _Nonnull phoneNumbers;
837
851
  /// The links/URLs that appear on the business card.
838
852
  @property (nonatomic, readonly, copy) NSArray<NSURL *> * _Nonnull links;
839
853
  /// The email addresses that appear on the business card.
@@ -846,9 +860,46 @@ SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultContact")
846
860
 
847
861
 
848
862
 
863
+ /// Class that enables structured data to be extracted from
864
+ /// scanned documents.
865
+ SWIFT_CLASS("_TtC5GSSDK26GSKStructuredDataExtractor")
866
+ @interface GSKStructuredDataExtractor : NSObject
867
+ - (nonnull instancetype)init;
868
+ @end
869
+
870
+
871
+
872
+ @interface GSKStructuredDataExtractor (SWIFT_EXTENSION(GSSDK))
873
+ /// Extract any bank details that were found in a given document by
874
+ /// passing in the result of performing OCR on that document. Use
875
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
876
+ /// was performed for languages that don’t support structured data extraction,
877
+ /// then this method will throw an error.
878
+ - (void)bankDetailsFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataBankDetails * _Nullable, NSError * _Nullable))completionHandler;
879
+ /// Extract any business card contact that was found in a given document
880
+ /// by passing in the result of performing OCR on that document. Use
881
+ /// <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
882
+ /// was performed for languages that don’t support structured data extraction,
883
+ /// then this method will throw an error.
884
+ - (void)businessCardContactFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataContact * _Nullable, NSError * _Nullable))completionHandler;
885
+ /// Extract any receipt/invoice information that was found in a given
886
+ /// document by passing in the result of performing OCR on that document.
887
+ /// Use <code>GSKOCR</code> to obtain a <code>GSKOCRResult</code> instance. Note that if OCR
888
+ /// was performed for languages that don’t support structured data extraction,
889
+ /// then this method will throw an error.
890
+ - (void)receiptFromOCRResult:(GSKOCRResult * _Nonnull)ocrResult completionHandler:(void (^ _Nonnull)(GSKStructuredDataReceipt * _Nullable, NSError * _Nullable))completionHandler;
891
+ @end
892
+
893
+ /// Enum defining errors that can be thrown by <code>GSKStructuredDataExtractor</code>.
894
+ /// Note that thrown errors will be wrapped in <code>NSError</code> containers.
895
+ typedef SWIFT_ENUM(NSInteger, GSKStructuredDataExtractorError, open) {
896
+ GSKStructuredDataExtractorErrorMissingRequiredOCRMetadata = -1,
897
+ };
898
+
899
+
849
900
  /// Phone number data extracted from a business card document through OCR.
850
- SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
851
- @interface GSKScanFlowStructuredDataResultPhoneNumber : NSObject
901
+ SWIFT_CLASS("_TtC5GSSDK28GSKStructuredDataPhoneNumber")
902
+ @interface GSKStructuredDataPhoneNumber : NSObject
852
903
  /// The label of the phone number. For example “Main”, “Office”, etc.
853
904
  @property (nonatomic, readonly, copy) NSString * _Nonnull label;
854
905
  /// A string representation of the phone number itself.
@@ -861,8 +912,8 @@ SWIFT_CLASS("_TtC5GSSDK42GSKScanFlowStructuredDataResultPhoneNumber")
861
912
  @class NSLocale;
862
913
 
863
914
  /// Receipt/invoice details extracted from a document through OCR.
864
- SWIFT_CLASS("_TtC5GSSDK38GSKScanFlowStructuredDataResultReceipt")
865
- @interface GSKScanFlowStructuredDataResultReceipt : NSObject
915
+ SWIFT_CLASS("_TtC5GSSDK24GSKStructuredDataReceipt")
916
+ @interface GSKStructuredDataReceipt : NSObject
866
917
  /// The locale that the receipt is in, if successfully extracted, otherwise <code>nil</code>.
867
918
  @property (nonatomic, readonly, copy) NSLocale * _Nullable locale;
868
919
  /// The merchant that the receipt is from, if successfully extracted, otherwise <code>nil</code>.
@@ -918,12 +969,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
918
969
  @end
919
970
 
920
971
 
921
-
922
972
  @interface GSKView (SWIFT_EXTENSION(GSSDK))
923
973
  - (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
924
974
  - (void)endSnapAnimation;
925
975
  @end
926
976
 
977
+
927
978
  @class NSBundle;
928
979
 
929
980
  SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")