Very Good Security Vault iOS SDK
This SDK is written in Swift 3.0, it requires Xcode 8.0 or above.
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
}
)
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
}];
To install the VaultSDK via CocoaPods, put following line in your Podfile
pod 'VaultSDK', '~> 1.0'
To install the VaultSDK via Carthage, put following line in your Cartfile
github "verygoodsecurity/vgs-ios-sdk" ~> 1.0
Open VaultSDK.xcworkspace
with Xcode, select target VaultSDKExample
and a simulator then run it via CMD + R.