Vault Mobile iOS SDK

The Vault Mobile iOS SDK provides an easy way for customers to build iOS applications which connects to Vault. For example, iOS developers can use the Vault Mobile iOS SDK to create standalone mobile applications installed on phones or tablets. The Vault Mobile iOS SDK provides key capabilities so developers don’t have to write complex integration code.

Features include:

The Vault Mobile SDK is an iOS framework that can be added to any iOS application. The classes and methods provided are available in the Documentation.

Getting Started

First, download the Vault Mobile iOS SDK. The download package contains the framework file as well as a sample iOS application that demonstrates how to use the SDK APIs. For more information about adding an external framework to your iOS application, please consult Apple's® documentation.

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)


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 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 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”.


The iOS SDK is provided with a license that allows users to use the SDK to build applications that connect to Vault. The license file is supplied inside the iOS SDK zip file that gets downloaded. The sample source files are available for users to copy and use for the purpose of creating an iOS application that connect to Vault.

Sample Application: Document Viewer

The download package for the iOS SDK also includes the code for a working sample application. The Document Viewer sample application allows users to log into Vault and query for documents. Users can then save queried documents locally to their device, allowing them to view these documents offline.

All documents and data is encrypted to ensure the application is secure.

Building and Deploying

  1. Install the latest version of Xcode™.
  2. Install CocoaPods™.
  3. Download the Vault iOS SDK distribution.
  4. From the iOS SDK Document Viewer folder, run: pod install.
  5. Open DocumentViewer.xcworkspace with Xcode™.
  6. Build and run with Xcode™.

Running the Application

You can run the application on a device or in the iOS simulator. The application presents the user with a login screen when it first starts. Users need to log in with a valid Vault user name and password. Note that this sample application is not configured to support an SSO user. After the user logs in for the first time, they will need to create a pin-code for offline use. The pin-code is required any time the application comes to the foreground to ensure it is secured.

The Document Viewer sample application is a basic viewer for document metadata and files. A user first selects any vault they have access to and then queries for documents. There are several ways to query documents in Vault: Browse (using global text search), Favorites, Recent, and My Documents. After performing a query on a document from the server, users can select to save (Snapshot) the document to their offline document storage inside the app. Users can save a document by either swiping on the document record in the list or saving from the document details page.

Document Library

The application will start by presenting a view of documents from the Library in the default vault for that user. The vault is listed in bold at the top of the screen above the list. You can change your current vault with the Switch Vault option inside the options menu (…). Users can also log off the application through this menu.

Saving Documents Locally

The application starts in Browse mode, noted by the icon at the bottom of the screen. In browse mode, users see a list of all documents either in the Library on the selected Vault server or saved locally onto the device. Selecting the tab at the top allows users to switch between the two lists and use the search bar to query documents. There are also other modes that query all documents on the Vault server. Users can select a document to save locally by swiping on the document record.

Downloading Documents

Users can click the blue Save icon to download and save the document.

Once the download completes, a green check mark displays on the document record. This indicates that the document saved locally. Whenever a Vault server query retrieves this document, it will also display a green check mark to show it was saved.

Viewing Saved Documents

If a user switches to the Saved Locally tab, they will see only their saved documents. This tab is useful when the device is offline and the Vault server cannot accept queries.

After saving the document locally, the user can select a record to navigate to a detail page where they can view the document. Note: If a user does not save a document locally, they will not have the option to view the document and will only see the document details and thumbnail image.

Users can select View to launch a viewer that displays the document. While in view mode, users can swipe to change pages, and use pinching and zooming to make it easier to read.

Removing Documents

From the detail page on a locally saved document, there is a red Remove option to remove the document from the device. The same option is available on the list by swiping and selecting the Remove option.