Skip to content

Internal development repository for iOS SDK. SDK will be made public in a separate repository.

License

Notifications You must be signed in to change notification settings

verloop/verloop_ios

Repository files navigation

VerloopSDK

CI Status Version License Platform

Installation

VerloopSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

    pod "VerloopSDK"

Then, run the following command:

    $pod install

Usage

  1. Initialise Verloop in application:didFinishLaunchingWithOptions.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let notificationSettings = UIUserNotificationSettings(types: [UIUserNotificationType.badge, UIUserNotificationType.sound, UIUserNotificationType.alert], categories: nil)
    application.registerUserNotificationSettings(notificationSettings)


    let config = VerloopConfig.init(subDomain: "name.stage", token: "test");
    config.name = "testName"
    config.email = "testEmail"
    config.msisdn = "testNumber"
    Verloop.sharedInstance.register(withConfig: config);
    return true
}
  1. Update the device token in application:didRegisterForRemoteNotificationsWithDeviceToken
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
    Verloop.sharedInstance.updateDeviceToken(withDeviceToken: deviceTokenString);
}
  1. Handle notification
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
    if Verloop.sharedInstance.isVerloopNotif(wihtNotif: userInfo) {
        Verloop.sharedInstance.handleNotif(withNotif: userInfo)
    }
}
  1. Start live chat
    Verloop.sharedInstance.showConversation()

Author

Verloop, [email protected]

License

VerloopSDK is available under the MIT license. See the LICENSE file for more info.

About

Internal development repository for iOS SDK. SDK will be made public in a separate repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published