iOS SDK

Desk360 is an iOS SDK that helps you embed customer support in your iOS applications with ease!

Features

The Desk360 SDK lets customers do any of the following:

  • Create new support tickets

  • View and comment on existing tickets

  • Interactively communicate with related support teams.

Installation

Using CocoaPods

To integrate Desk360 in your Xcode project using CocoaPods, specify it in your Podfile:

pod 'Desk360'

Usage

You must add your info.plist file.

<key>NSPhotoLibraryUsageDescription</key>
<string>Allow the app to access your photos.</string>

Permission text is optional. You can type whatever you want, but this permission is not optional. If you don't add this permission, Desk360 Images attachment property won't work.

Start Desk360 with appId -and an optional deviceId, an optional language-

import Desk360
Desk360.start(appId: "12345")
Desk360.start(appId: "12345", deviceId: "34567", environment: .production, language: "en", jsonInfo: jsonObject: [String: Any] = ["yourInfoKey": "yourInfoValue"])

If no deviceId is provided, Desk360 will use device's UUID, which might cause your app to lose tickets when the application is deleted. If your environment type is production, Desk360 will look at prod url. If no application language is provided, Desk360 will use device's language.

Using Desk360

import Desk360
class ExampleViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Desk360.show(on: self, animated: true)
}
}

Using Optional Notification System

If you need to send a notification when a message is sent to the users, this integration is required.

import Desk360
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Desk360.setPushToken(deviceToken: deviceToken)
}
}

After the above integration, it is sufficient to change the notification certificate settings in the Desk360 admin panel. You can now use notifications

Also if you want notification redirect deeplink system further integration is required.

import Desk360
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Desk360.setPushToken(deviceToken: deviceToken)
}
}
// MARK: - UNUserNotificationCenterDelegate
extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.alert])
Desk360.willNotificationPresent(notification.request.content.userInfo)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Desk360.applicationUserInfoChecker(userInfo)
}
@available(iOS 10.0, *)
public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
Desk360.applicationUserInfoChecker(response.notification.request.content.userInfo)
}
}

When you click on the notification when your application is closed, you need to add this code on the page you want Desk360 to open.

import Desk360
final class YourMainViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Desk360.showWithPushDeeplink(on: self)
}
}

Customize Desk360 Theme

You should use Desk360 dashboard for custom config.

For further information, please with contact us [email protected]