VaultMobileSDK  191.0.1
iOS framework for Vault API
VaultMobileSDK for iOS

Introduction

VaultMobileSDK is an iOS framework that simplifies connecting and interacting with Vault from an iOS application. It provides support for authorization, secure local storage for your application's documents, support for uploading those documents to Vault, and a client-side passcode lock screen.

Quick Start

Integrating VaultMobileSDK

First, pull the VaultMobileSDK framework into your project by following Apple's instructions for embedding a framework in iOS Apps.

Next, import the framework in your application's UIApplicationDelegate class:

import VaultMobileSDK

Next, modify your application's UIApplicationDelegate by adding the following line somewhere in your application:didFinishLaunchingWithOptions: method:

VEVSDKApplicationDelegate.sharedInstance().application(app, didFinishLaunchingWithOptions: launchOptions)

Authentication

Next, find a place in your code that's convenient to run Vault authentication and then add import VaultMobileSDK as above. Then simply include the following call:

VEVVaultAuth.sharedInstance().authenticate{ (_, error) in
    if let error = error as NSError?  {
        print("Error authenticating user:\(error)")
    } else {
        print("User authenticated")
    }
 }

When you run your app and execute the code above you will be prompted for your Vault login credentials. Once authenticated, you will then be prompted to set a PIN code for the app. You will see the output from the callbacks in XCode's console when the SDK returns control back to your application.

App Store Submission

VaultMobileSDK contains binary code for both iOS device architectures and for desktop architectures. Including desktop architectures enables VaultMobileSDK to run on simulators during development but unfortunately iTunes Connect will reject any app submission that contains binary code for simulators. To circumvent this, VaultMobileSDK includes a script that strips these binaries when you archive your project for submission.

To incorporate this script into your build environment first go to your target's Build Phases configuration screen.

Next click the + icon and select New Run Script Phase. Drag this new phase below the Embed Frameworks phase if necessary.

In the file system location where you downloaded VaultMobileSDK, locate strip-frameworks.sh and drag this file to the Run Script window where the prompt that says "Type a script or drag a script file from your workspace to insert its path."

Check the box that says "Run script only when installing".