Driftt / drift-sdk-ios

Drift for iOS, for integrating Drift into your iOS application.

Home Page:http://www.drift.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drift

CocoaPods

DriftSDK is the official Drift SDK written in Swift!

Deprecated – Please see https://devdocs.drift.com/ for more details on how to integrate Drift with your application

Features:

  • Create conversations from your app
  • View past conversations from your app.

Requirements:

  • Xcode 11.0+
  • Swift 5+
  • iOS 10

Getting Setup

Installation

DriftSDK can be added to your project using CocoaPods by adding the following line to your Podfile:

pod 'Drift', '~> 2.4.1'

Registering

To use the Drift iOS SDK you need an embed ID from your Drift settings page. This can be accessed here by looking after the drift.load method in the Javascript SDK.

In your AppDelegate didFinishLaunchingWithOptions call:

  Drift.setup("")

or in ObjC

  [Drift setup:@""];

Once your user has successfully logged into the app registering a user with the device is done by calling register user with a unique identifier, typically the id from your database, and their email address:

  Drift.registerUser("", email: "")

or in ObjC

  [Drift registerUser:@"" email:@""];

When your user logs out simply call logout so they stop receiving campaigns.

  Drift.logout()

or in ObjC

  [Drift logout];

Thats it. Your good to go!!

Messaging

A user can begin a conversation in response to a campaign or by presenting the conversations list

  Drift.showConversations()

or in ObjC

  [Drift showConversations];

You can also go directly to create a conversation using

  Drift.showCreateConversation()

or in ObjC

  [Drift showCreateConversation];

Thats it. Your good to go!!

Contributing

Contributions are very welcome 🤘.

About

Drift for iOS, for integrating Drift into your iOS application.

http://www.drift.com

License:MIT License


Languages

Language:Swift 99.4%Language:Ruby 0.4%Language:Objective-C 0.2%