Skip to content

armaanbindra/voiceit-sdk-iOS-1

Repository files navigation

VoiceIt SDK for iOS

A library that gives you out of the box access to the VoiceIt's Voice Authentication API right from your iOS app. For more information on VoiceIt and its features, see the website and getting started docs

Getting Started

To use the VoiceIt in your iOS app, if you haven't already, please Sign Up for a free Developer Id at http://voiceit.tech. Then either fork this repository and try the DemoStarterProjectSwift or DemoStarterProjectObjectiveC , otherwise you can also manually download the VoiceIt iOS SDK Zip and follow the installation instructions below.

Installation

Once you have downloaded the VoiceIt iOS SDK Zip simply drag and drop both the VoiceItResources.bundle and VoiceItSDK.framework file into your project.

After successfully adding the framework and resources bundle you will need to add some built in iOS frameworks that are required by the iOS SDK. You are required to add the following frameworks:

1. SystemConfiguration.framework
2. AVFoundation.framework
3. MediaPlayer.framework

To do so please follows these steps:

  • In the project editor, select the target to which you want to add a library or framework.
  • Click Build Phases at the top of the project editor.
  • Open the Link Binary With Libraries section.
  • Click the Add button (+) to add a library or framework.
  • Select a library or framework from the list and click Add.

alt text

Congratulations you now have the SDK Installed and can start programming with it, please follow the Setup instructions below to continue.

Setup

Swift

If you are programming in Swift then you need to first setup an Objective-C bridging header before starting. You can follow this guide to create a bridging header. Then add the following to the top of the bridging-header file:

#import <VoiceItSDK/VoiceItSDK.h>

After importing the library in the file we can initialize the VoiceItLogin View Controller by adding the following code snippet wherever we like, in our code.

let vc = VoiceItLogin(
  DEVELOPER_ID_HERE,
  userToken: USER_TOKEN_HERE,
  vpPhrase: "Never forget tomorrow is a new day",
  textConfidence: "30.0",
  confidence: "89" ,
  callback: { (result) -> Void in
    if result == "Success"
    {
        //DO SOMETHING IF SUCCESSFULLY AUTHENTICATED
    }
    else if result == "Failed"
    {
        //DO SOMETHING IF AUTHENTICATION FAILED
    }
})
self.presentViewController(vc, animated: true, completion: nil)

Objective-C

If you are programming in Objective-C then you can simply import the SDK into whichever .h or .m file you would like to use it, with the import statement.

#import <VoiceItSDK/VoiceItSDK.h>

After importing the library in the file we can initialize the VoiceItLogin View Controller by adding the following code snippet wherever we like, in our code.

VoiceItLogin * vc =
 [[VoiceItLogin alloc] init:DEVELOPER_ID_HERE
 userToken:USER_TOKEN_HERE
 vpPhrase:@"Never forget tomorrow is a new day"
 textConfidence:@"30.0"
 confidence:@"89"
 callback:^(NSString *result) {
       if ([result isEqualToString:@"Success"]) {
           //DO STUFF WHEN AUTHENTICATED SUCCESSFULLY
       }
       else{
           //DO STUFF IF AUTHENTICATION FAILED
       }
       }];
[self presentViewController:vc animated:YES completion:nil];

##Preview alt text alt text alt text alt text alt text alt text

##Attributions Thanks to Mohd Iftekhar Qurashi for his awesome IQAudioRecorderController library.

About

This is the Official iOS SDK For the VoiceIt Rest API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published