Add the listed code to import the SDK and to run the correct protocol. Then start the SDK and set up the callback scheme.

Table 1. Code to Add to Import the SDK and to Set Up the Callback Scheme

Task

Code

Add the listed code to the AppDelegate.

import AWSDK

Code the AppDelegate to use the AWSDKDelegate protocol.

import AWSDK
class AppDelegate: UIResponder, UIApplicationDelegate, AWSDKDelegate {
  ...
}

Set the AppDelegate, setup the callback scheme, and start the SDK.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
    {
        // Override point for customization after application launch.
        let awc = AWController.clientInstance()
        awc.delegate = self
        // Your application's scheme name
        awc.callbackScheme = "myCallBackSchemeName"
        awc.start()
        return true
    }

Set the AppDelegate's class to use the listed protocols.

// Called once the SDK has finished its setup
func controllerDidFinishInitialCheck(Error error: NSError?) {
    AWLogDebug("SDK Initial Check Done!")
}

// Called when the configurations profiles have been recieved from console and can now be accessed from AWController or from the parameter in this call back
func receivedProfiles(profiles: NSArray) {
	AWLogDebug("SDK received Profiles!")
}

// Called when the SDK has locked
func lock() {
	AWLogDebug("SDK locked!")
}

// Called when the SDK has unlocked
func unlock() {
	AWLogDebug("SDK unlocked!")
}

// Called when the SDK has wiped all of its data; the application wipes any of its application-specific data
func wipe() {
    AWLogDebug("SDK started wiping application!")
}

// Called to alert the application to stop its network activity
func stopNetworkActivity(networkActivityStatus: AWNetworkActivityStatus) {

}

// Called to alert the application to resume its network activity
func resumeNetworkActivity() {

}