Desk360 Docs
Search…
iOS SDK
Desk360 is an iOS SDK to help you embedding customer support in your iOS applications with ease!

Features

The Desk360 Mobile SDK for iOS lets customers do any of the following:
  • Create new support tickets.
  • View and comment on existing tickets.
  • Interactively communicate with related support teams.
  • Use functions such as ticket prioritization, folder creating, SLA setting, etc.
  • Get detailed reports on both tickets and support agents.
  • Customize the look of your support system on Desk360 panel.

Installation

Using CocoaPods

To integrate Desk360 in your Xcode project using CocoaPods, specify it in your Podfile:
1
pod 'Desk360'
Copied!

Using SPM

1
dependencies: [
2
.package(url: "https://github.com/Teknasyon-Teknoloji/desk360-ios-sdk", .branch("master"))
3
]
Copied!

Usage

Important footnot

You must add your info.plist file.
1
<key>NSPhotoLibraryUsageDescription</key>
2
<string>Allow the app to access your photos.</string>
Copied!
Permission text is optional. you can type whatever you want. But this permission not optional. If you didn't add this permission. Desk360 Images attachment property doesn't work.

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

Note: 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 use environment type .production, Desk360 will look at prod url. If no application language is provided, Desk360 will use device's language.
1
import Desk360
2
​
3
let props = Desk360Properties(appID: "1234")
4
​
5
// Or if you would like to provide more info here is a full list of the params
6
let props = Desk360Properties(
7
appKey: "1234",
8
deviceID: "34567",
9
environment: .production,
10
language: "en",
11
country: "TR",
12
userCredentials: .init(name: "John Doe", email: "[email protected]"),
13
bypassCreateTicketIntro: true,
14
jsonInfo: ["a": 500, "b": "c"]
15
)
16
​
17
Desk360.start(using: props)s
Copied!

Using Desk360

1
import Desk360
2
​
3
class ExampleViewController: UIViewController {
4
​
5
override func viewDidLoad() {
6
super.viewDidLoad()
7
Desk360.show(on: self, animated: true)
8
}
9
10
}
Copied!

Using Optional Notification System

If you need to send a notification when a message is sent to the users. You have to do this integration.
1
import Desk360
2
​
3
@UIApplicationMain
4
final class AppDelegate: UIResponder, UIApplicationDelegate {
5
​
6
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
7
Desk360.setPushToken(deviceToken: deviceToken)
8
}
9
10
}
Copied!
After the above integration, it is sufficient to make the notification certificate settings in the Desk360 admin panel. You can now use notifications
Also if you want notification redirect deeplink system. You should some extra integration.
1
import Desk360
2
​
3
@UIApplicationMain
4
final class AppDelegate: UIResponder, UIApplicationDelegate {
5
6
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
7
8
Desk360.applicationLaunchChecker(launchOptions)
9
if #available(iOS 10.0, *) {
10
let center = UNUserNotificationCenter.current()
11
center.delegate = self
12
}
13
return true
14
15
}
16
}
17
​
18
​
19
// MARK: - UNUserNotificationCenterDelegate
20
extension AppDelegate: UNUserNotificationCenterDelegate {
21
​
22
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
23
completionHandler([.alert])
24
Desk360.willNotificationPresent(notification.request.content.userInfo)
25
}
26
​
27
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
28
Desk360.applicationUserInfoChecker(userInfo)
29
}
30
31
@available(iOS 10.0, *)
32
public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
33
Desk360.applicationUserInfoChecker(response.notification.request.content.userInfo)
34
}
35
}
Copied!
When you click on the notification when your application is closed, you need to add this code on which page you want Des360 to open.
1
import Desk360
2
​
3
final class YourMainViewController: UIViewController {
4
​
5
override func viewDidLoad() {
6
super.viewDidLoad()
7
8
Desk360.showWithPushDeeplink(on: self)
9
}
10
​
11
}
Copied!

Getting the unread tickets

If you would like to get a list of the unread tickets you can do so like follows:
1
Desk360.getUnreadTickets { results in
2
switch results {
3
case .failure(let error):
4
print(error.localizedDescription)
5
case .success(let tickets):
6
print("Tickets: \(tickets.count)")
7
}
8
}
Copied!
You can show the unread tickets the way that fits your app design and expierence. If you want to navigate to a specific ticket detail you can do so so by following:
1
let detailsViewController = Desk360.ticketDetailsViewController(ofTicket: unreadTicket)
2
self.present(detailsViewController, animated: true, completion: nil)
Copied!

Customize Desk360 Theme

You should use Desk360 dashboard for custom config.

Support

For further information, please with contact us [email protected]​
​
Visit our GITHUB page for usage, technical setup and detailed info.
​