Latest 0.4
Homepage https://github.com/voiceittech/VoiceItAPI1IosSDK
License MIT
Platforms ios 8.0
Frameworks UIKit, AVFoundation
Authors

Version
License
Platform

VoiceIt API 1.0 iOS SDK

A library that gives you access to the VoiceIt’s API 1.0 enabling you to add Voice Authentication to your iOS app.

Getting Started

Get a Developer Account at VoiceIt. Also review the HTTP Documentation at VoiceIt api docs. All the documentation shows code snippets in both Swift 3 and Objective-C.

Installation

VoiceItAPI1IosSDK is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "VoiceItAPI1IosSDK"

and then run pod install in your terminal

pod install

API Calls

Initialization

Swift

First import VoiceItAPI1IosSDK into your Swift file then initialize a reference to the SDK inside a ViewController

import VoiceItAPI1IosSDK

class ViewController: UIViewController {
    var myVoiceIt:VoiceItAPIOne?

    override func viewDidLoad() {
        super.viewDidLoad()
        myVoiceIt  = VoiceItAPIOne("DEVELOPER_ID_HERE")
    }
}

Objective-C

First import VoiceItAPIOne.h into your Objective-C file, then initialize a reference to the SDK inside a ViewController

#import "ViewController.h"
#import "VoiceItAPIOne.h"

@interface ViewController ()
    @property VoiceItAPIOne * myVoiceIt;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _myVoiceIt = [[VoiceItAPIOne alloc] init: "DEVELOPER_ID_HERE"];
}

User API Calls

Create User

Create a new user with the provided userId(alphanumeric string between 5 -36 characters)

Swift
myVoiceIt?.createUser("USER_ID_HERE", password:"PASSWORD_HERE", {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt createUser:@"USER_ID_HERE" password:@"PASSWORD_HERE" callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
}];

Get User

Check whether a user exists for the given userId

Swift
myVoiceIt?.getUser("USER_ID_HERE", password:"PASSWORD_HERE", callback: {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt getUser:@"USER_ID_HERE" password:@"PASSWORD_HERE" callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
}];

Delete User

Delete user with given userId

Swift
myVoiceIt?.deleteUser("USER_ID_HERE", password:"PASSWORD_HERE"password:"PASSWORD_HERE", , callback: {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt deleteUser:@"USER_ID_HERE" password:@"PASSWORD_HERE" callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
}];

Enrollment API Calls

Get Enrollments

Gets enrollments for user with given userId

Swift
myVoiceIt?.getEnrollments("USER_ID_HERE", password:"PASSWORD_HERE", callback: {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt getEnrollments:@"USER_ID_HERE" password:@"PASSWORD_HERE" callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
}];

Delete Enrollment

Delete enrollment for user with given userId and enrollmentId(integer)

Swift
myVoiceIt?.deleteEnrollment("USER_ID_HERE", password:"PASSWORD_HERE", enrollmentId: "ENROLLMENT_ID_HERE", callback: {
    jsonResponse in
})
Objective-C
[_myVoiceIt deleteEnrollment:@"USER_ID_HERE" password:@"PASSWORD_HERE" enrollmentId:@"ENROLLMENT_ID_HERE" callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
}];

Create Enrollment

Create audio enrollment for user with given userId and contentLanguage(‘en-US’,’es-ES’ etc.). Note: Immediately upon calling this method it records the user saying their VoicePrint phrase for 5 seconds calling the recordingFinished callback first, then it sends the recording to be added as an enrollment and returns the result in the callback

Swift
myVoiceIt?.createEnrollment("USER_ID_HERE", password:"PASSWORD_HERE", contentLanguage: "CONTENT_LANGUAGE_HERE", recordingFinished: {
    print("Audio Enrollment Recording Finished, now waiting for API Call to respond")
}, callback: {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt createEnrollment:@"USER_ID_HERE" password:@"PASSWORD_HERE" contentLanguage: @"CONTENT_LANGUAGE_HERE" recordingFinished:^(void){
    NSLog(@"Audio Enrollment Recording Finished, now waiting for API Call to respond");
} callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
} ];

Authentication

Authenticate user with the given userId and contentLanguage(‘en-US’,’es-ES’ etc.). Note: Immediately upon calling this method it records the user saying their VoicePrint phrase for 5 seconds calling the recordingFinished callback first, then it sends the recording to be verified and returns the resulting confidence in the callback

Swift
myVoiceIt?.authentication("USER_ID_HERE", password:"PASSWORD_HERE", contentLanguage: "CONTENT_LANGUAGE_HERE", recordingFinished: {
    print("Authentication Recording Finished, now waiting for API Call to respond")
}, callback: {
    jsonResponse in
    print("JSON RESPONSE: (jsonResponse!)")
})
Objective-C
[_myVoiceIt authentication:@"USER_ID_HERE" password:@"PASSWORD_HERE" contentLanguage:@"CONTENT_LANGUAGE_HERE" recordingFinished:^(void){
    NSLog(@"Authentication Recording Finished, now waiting for API Call to respond");
} callback:^(NSString * jsonResponse){
    NSLog(@"JSONResponse: %@", jsonResponse);
} ];

Author

armaanbindra, [email protected]

License

VoiceItAPI1IosSDK is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "VoiceItAPI1IosSDK",
    "version": "0.4",
    "summary": "A pod that lets you add authentication to your iOS apps, brought to you by VoiceIt",
    "description": "A pod that lets you add authentication to your iOS apps, brought to you by VoiceIt. Please visit https://voiceit.tech to learn more and sign up for an account.",
    "homepage": "https://github.com/voiceittech/VoiceItAPI1IosSDK",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "armaanbindra": "[email protected]"
    },
    "source": {
        "git": "https://github.com/voiceittech/VoiceItAPI1IosSDK.git",
        "tag": "0.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "VoiceItAPI1IosSDK/Classes/**/*",
    "frameworks": [
        "UIKit",
        "AVFoundation"
    ]
}

Pin It on Pinterest

Share This