Skip to content
Drift for iOS, for integrating Drift into your iOS application.
Swift Other
  1. Swift 98.9%
  2. Other 1.1%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Drift.xcodeproj
Drift.xcworkspace
Drift
DriftTests
Example/SDKExample
.gitignore
.gitmodules
Cartfile
Cartfile.resolved
Drift-SDK.podspec
Drift.podspec
LICENSE
Podfile
Podfile.lock
README.md

README.md

Drift

CocoaPods

DriftSDK is the official Drift SDK written in Swift enabling you to both send announcements and collect vital NPS responses all within the app!

Features:

  • Send Product announcements to your customers
  • Create conversations from your app
  • View past conversations from your app.

Getting Setup

Installation

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

pod 'Drift', '~> 2.2.9'

Registering

To get started with 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!!

Archived Campaigns

Once a campaign is delivered to a user it will keep showing to a user until it is dismissed or completed. This happens even when the campaign is inactive or archived. If you would like to only show active campaign you can enable this by passing false to showArchivedCampaignsForEndUser during setup

  Drift.showArchivedCampaignsForEndUser(false)

or in ObjC

  [Drift showArchivedCampaignsForEndUser:NO];

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 🤘.

You can’t perform that action at this time.