The Knurld Swift SDK wraps the Knurld web API to simplify integration of Knurld's voice verification services with your iOS applications.
To learn more about Knurld, please visit us at https://www.knurld.io.
If you encounter any issues using this SDK, please reach out to our development team at developer@knurld.com.
- iOS 8.0+
Add the Knurld Swift SDK to your Cartfile
:
github "knurld/Swift-SDK"
Make sure to link both the KnurldSDK and Freddy frameworks; the Knurld SDK depends on Freddy for working with JSON.
Add the Knurld Swift SDK to your Podfile
:
pod 'KnurldSDK', :git => 'https://github.com/knurld/Swift-SDK.git'
Create an instance of KnurldAPI
and execute all of your requests against its members. For example, to check the status of the Knurld services:
-
Create an instance of
KnurldAPI
:let api = KnurldAPI()
-
Get an access token using your API credentials:
let oAuthCredentials = OAuthCredentials(clientID: "your client ID", clientSecret: "your client secret") var knurldCredentials: KnurldCredentials? api.authorization.authorize(credentials: oAuthCredentials, developerID: "your developer ID", successHandler: { knurldCredentials = $0 }, failureHandler: { print("ERROR: \($0)") })
-
Once
knurldCredentials
is non-nil, ask the API for its status:var status: ServiceStatus? api.status.get(credentials: knurldCredentials, successHandler: { status = $0 }, failureHandler: { print("ERROR: \($0)") })
-
Once
status
is non-nil, it will contain the Knurld service status.if let status = status { print("Knurld API version is \(status.version)") }
Full documentation of the SDK is at https://knurld.github.io/Swift-SDK/. The SDK documentation assumes familiarity with the Knurld web API.
For details on the Knurld web API, especially to learn its call flow and the significance of each call's data types, please see the Knurld developer guide.
To develop this SDK:
- Install Carthage on your system, if it isn't already installed
- Clone the SDK repository and run
./bin/setup
from the repository root - Open KnurldSDK.xcworkspace in Xcode and develop
- To test, populate your Knurld API credentials in
KnurldSDKTests/TestCredentials.swift
and run Product -> Test in Xcode