Skip to content

Commit

Permalink
IOS-34 Refactor FaceVerification and VideoVerification Controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
noelgrover committed Mar 12, 2021
1 parent 8af90f0 commit 20c694d
Show file tree
Hide file tree
Showing 16 changed files with 757 additions and 487 deletions.
4 changes: 2 additions & 2 deletions Example/VoiceIt2-IosSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@
GCC_PREFIX_HEADER = "VoiceIt2-IosSDK/VoiceIt2-IosSDK-Prefix.pch";
INFOPLIST_FILE = "VoiceIt2-IosSDK/VoiceIt2-IosSDK-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.2.3;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = io.voiceit.iosSdkOneDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -618,7 +618,7 @@
GCC_PREFIX_HEADER = "VoiceIt2-IosSDK/VoiceIt2-IosSDK-Prefix.pch";
INFOPLIST_FILE = "VoiceIt2-IosSDK/VoiceIt2-IosSDK-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.2.3;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = io.voiceit.iosSdkOneDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
19 changes: 5 additions & 14 deletions Example/VoiceIt2-IosSDK/VoiceItViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,15 @@ - (void)viewDidLoad
{
[super viewDidLoad];

self.API_KEY = @"key_1df99ca38b97488499e1fe9db9a55e6c";
self.API_TOKEN = @"tok_3d43dcd14f6349ee93247b4a3eb2adc4";
self.TEST_USER_ID_ONE = @"usr_deb2d9d8da3949468b12142965771392";
self.TEST_USER_ID_TWO = @"usr_64542b8fead840428cec1939342fb52f";
self.API_KEY = @"API_KEY_HERE";
self.API_TOKEN = @"API_TOKEN_HERE";
self.TEST_USER_ID_ONE = @"USER_ID_HERE";
self.TEST_USER_ID_TWO = @"USER_ID_HERE";
self.TEST_USER_ID = self.TEST_USER_ID_ONE;
self.TEST_GROUP_ID = @"grp_2a0b47a8174b44f89587aebd95086ae2";
self.TEST_GROUP_ID = @"GROUP_ID_HERE";
self.TEST_PHRASE = @"never forget tomorrow is a new day";
self.TEST_CONTENT_LANGUAGE = @"en-US";

// self.API_KEY = @"API_KEY_HERE";
// self.API_TOKEN = @"API_TOKEN_HERE";
// self.TEST_USER_ID_ONE = @"USER_ID_HERE";
// self.TEST_USER_ID_TWO = @"USER_ID_HERE";
// self.TEST_USER_ID = self.TEST_USER_ID_ONE;
// self.TEST_GROUP_ID = @"GROUP_ID_HERE";
// self.TEST_PHRASE = @"never forget tomorrow is a new day";
// self.TEST_CONTENT_LANGUAGE = @"en-US";

NSMutableDictionary * styles = [[NSMutableDictionary alloc] init];
[styles setObject:@"#FBC132" forKey:@"kThemeColor"];
[styles setObject:@"default" forKey:@"kIconStyle"];
Expand Down
2 changes: 1 addition & 1 deletion VoiceIt2-IosSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

Pod::Spec.new do |s|
s.name = 'VoiceIt2-IosSDK'
s.version = '2.2.2'
s.version = '2.2.3'
s.summary = 'A pod that lets you add voice and face verification and identification to your iOS apps, brought to you by VoiceIt.'

# This description is used to generate tags and improve search results.
Expand Down
72 changes: 35 additions & 37 deletions VoiceIt2-IosSDK/Classes/Base.lproj/VoiceIt.storyboard

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions VoiceIt2-IosSDK/Classes/FaceEnrollmentViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

#pragma mark - Graphics/UI/Constraints/Animations
@property CGFloat originalMessageLeftConstraintContstant;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *messageleftConstraint;
@property (weak, nonatomic) IBOutlet UILabel *messageLabel;
@property (weak, nonatomic) IBOutlet SpinningView *progressView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * messageleftConstraint;
@property (weak, nonatomic) IBOutlet UILabel * messageLabel;
@property (weak, nonatomic) IBOutlet SpinningView * progressView;
@property CGPoint cameraCenterPoint;
@property CAShapeLayer * progressCircle;
@property CALayer * cameraBorderLayer;
Expand All @@ -31,9 +31,9 @@
#pragma mark - Camera Related Stuff
@property AVCaptureSession * captureSession;
@property AVCaptureDevice * videoDevice;
@property AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong) NSData *finalCapturedPhotoData;
@property(nonatomic, strong) AVCaptureVideoDataOutput *videoDataOutput;
@property AVCaptureVideoPreviewLayer * previewLayer;
@property (nonatomic, strong) NSData * finalCapturedPhotoData;
@property(nonatomic, strong) AVCaptureVideoDataOutput * videoDataOutput;
@property(nonatomic, strong) dispatch_queue_t videoDataOutputQueue;

#pragma mark - Boolean Switches
Expand Down
2 changes: 1 addition & 1 deletion VoiceIt2-IosSDK/Classes/FaceEnrollmentViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ -(void)setupCameraCircle{
self.cameraBorderLayer.cornerRadius = circleWidth / 2;

// Setup Rectangle Around Face
self.faceRectangleLayer = [[CALayer alloc] init];
[Utilities setupFaceRectangle:self.faceRectangleLayer];

[rootLayer addSublayer:self.cameraBorderLayer];
[rootLayer addSublayer:self.progressCircle];
[rootLayer addSublayer:self.previewLayer];
Expand Down
29 changes: 16 additions & 13 deletions VoiceIt2-IosSDK/Classes/FaceVerificationViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@

#pragma mark - Graphics/UI/Constraints/Animations
@property CGFloat originalMessageLeftConstraintContstant;
@property (weak, nonatomic) IBOutlet UIView *verificationBox;
@property (weak, nonatomic) IBOutlet UILabel *messageLabel;
@property (weak, nonatomic) IBOutlet SpinningView *progressView;
@property (weak, nonatomic) IBOutlet UIView * verificationBox;
@property (weak, nonatomic) IBOutlet UILabel * messageLabel;
@property (weak, nonatomic) IBOutlet SpinningView * progressView;
@property CGPoint cameraCenterPoint;
@property CAShapeLayer * progressCircle;
@property CALayer * cameraBorderLayer;
@property CALayer * faceRectangleLayer;
@property CALayer *rootLayer;
@property CALayer * rootLayer;

#pragma mark - Camera Related Stuff
@property AVCaptureSession * captureSession;
@property AVCaptureDevice * videoDevice;
@property(nonatomic, strong) AVCaptureVideoDataOutput *videoDataOutput;
@property(nonatomic, strong) AVCaptureVideoDataOutput * videoDataOutput;
@property(nonatomic, strong) dispatch_queue_t videoDataOutputQueue;
@property(nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong) NSData *finalCapturedPhotoData;
@property (nonatomic,strong) AVAudioPlayer *player;
@property(nonatomic, strong) AVCaptureVideoPreviewLayer * previewLayer;
@property (nonatomic, strong) NSData * finalCapturedPhotoData;
@property (nonatomic,strong) AVAudioPlayer * player;

#pragma mark - Boolean Switches
@property BOOL lookingIntoCam;
@property BOOL isRecording;
@property BOOL continueRunning;
@property BOOL enoughRecordingTimePassed;
@property BOOL doLivenessDetection;
@property BOOL doAudioPrompts;
@property BOOL verificationStarted;
@property BOOL isReadyToWrite;
@property BOOL imageNotSaved;
@property BOOL imageIsSaved;
@property BOOL cancelPlayback;

#pragma mark - Counters to keep track of stuff
@property int lookingIntoCamCounter;
Expand All @@ -54,12 +54,15 @@
@property int numberOfLivenessFailsAllowed;

#pragma mark - Developer Passed Options
@property (strong, nonatomic) NSString * userToVerifyUserId;
@property (strong, nonatomic) NSObject * voiceItMaster;
@property NSString * contentLanguage;
@property (strong, nonatomic) NSString * userToVerifyUserId;
@property (strong, nonatomic) NSObject * voiceItMaster;
@property (strong, nonatomic) NSString * contentLanguage;

#pragma mark - callbacks
@property (nonatomic, copy) void (^userVerificationCancelled)(void);
@property (nonatomic, copy) void (^userVerificationSuccessful)( float, NSString *);
@property (nonatomic, copy) void (^userVerificationFailed)( float, NSString *);

@property (nonatomic, copy) void (^userVerificationSuccessfulWithLiveness)(NSString *);
@property (nonatomic, copy) void (^userVerificationFailedWithLiveness)(NSString *);
@end

0 comments on commit 20c694d

Please sign in to comment.