Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.89 KB

README.md

File metadata and controls

71 lines (51 loc) · 1.89 KB

vgs-ios-sdk

Build Status CocoaPods Carthage compatible license

Very Good Security Vault iOS SDK

Requirements

This SDK is written in Swift 3.0, it requires Xcode 8.0 or above.

Usage example in Swift 3.0

import VaultSDK

let api = VaultAPI(
    baseURL: URL(string: "https://demo.sandbox.verygoodvault.com")!,
    publishableKey: "demo-user"
)
api.createToken(
    payload: "4111111111111111",
    failure: { error in
        // Handle the error here
    },
    success: { token in
        // Use the token here
    }
)

Usage example in Objective C

Import the SDK like this

@import VaultSDK;

then

VaultAPI *api = [[VaultAPI alloc] initWithBaseURL:[NSURL URLWithString:@"https://demo.sandbox.verygoodvault.com"] publishableKey:@"demo-user" urlSession:[NSURLSession sharedSession]];

[api createTokenWithPayload:@"4111111111111111" failure:^(NSError * _Nonnull error) {
    // Handle the error here
} success:^(NSDictionary<NSString *,id> * _Nonnull token) {
    // Use the token here
}];

Install via CocoaPods

To install the VaultSDK via CocoaPods, put following line in your Podfile

pod 'VaultSDK', '~> 1.0'

Install via Carthage

To install the VaultSDK via Carthage, put following line in your Cartfile

github "verygoodsecurity/vgs-ios-sdk" ~> 1.0

Run example app

Open VaultSDK.xcworkspace with Xcode, select target VaultSDKExample and a simulator then run it via CMD + R.