Skip to content

verygoodbot/vgs-ios-sdk

 
 

Repository files navigation

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.

About

Very Good Security iOS SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 89.5%
  • Ruby 6.1%
  • Objective-C 4.4%