Skip to content

Instantly share code, notes, and snippets.

@jurezove
Last active February 3, 2016 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jurezove/cf5d82cfe9926f06efed to your computer and use it in GitHub Desktop.
Save jurezove/cf5d82cfe9926f06efed to your computer and use it in GitHub Desktop.
Zendesk init
// Init in application:didFinishLaunchingWithOptions
ZDKConfig.instance().initializeWithAppId(OTConstants.Services.ZendeskAppID, zendeskUrl: OTConstants.Services.ZendeskURL, clientId: OTConstants.Services.ZendeskClientID, onSuccess: { () -> Void in
}) { (error: NSError!) -> Void in
debugPrint("Error initializing ZenDesk: \(error)")
}
// Identifying or re-identifying the user
class func identifyUser(user: OTKUser) {
let identity = ZDKAnonymousIdentity()
identity.name = user.fullName
identity.email = user.email
ZDKConfig.instance().userIdentity = identity
}
// Output
2016-02-03 08:40:54.804 tax[20349:11576324] [DEBUG]: SDK configuration file found in local storage
2016-02-03 08:40:54.805 tax[20349:11576324] [DEBUG]: Reachability Flag Status: -R ------- networkStatusForFlags
2016-02-03 08:40:54.806 tax[20349:11579063] [DEBUG]: About to execute [0x7fdb28711590]: https://1tap.zendesk.com/api/mobile/sdk/settings/cf6d39a0192c8b16a9622ad393101a40ca87de4d4eb7ea99.json
with headers
{
Accept = "application/json";
"Accept-Language" = "en-US";
"Client-Identifier" = "mobile_sdk_client_893a8fcfd5c4b79d9190";
"Content-Type" = "application/json";
"Mobile-Sdk-Identity" = "A1EEB7C0-07D6-45B9-A179-6172BE3DB867";
"User-Agent" = "Zendesk-SDK/1.4.1.4 iOS/9.2 Env/Development";
}
2016-02-03 08:40:56.160 tax[20349:11578887] [DEBUG]: Response code [0x7fdb28711590]: 200
2016-02-03 08:40:56.160 tax[20349:11576324] [DEBUG]: Request success: [0x7fdb28711590]: https://1tap.zendesk.com/api/mobile/sdk/settings/cf6d39a0192c8b16a9622ad393101a40ca87de4d4eb7ea99.json
2016-02-03 08:40:56.163 tax[20349:11576324] [DEBUG]: No support for en-US, Help Center is enabled in your application settings
2016-02-03 08:40:56.165 tax[20349:11576324] [DEBUG]: Successfully updated SDK settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment