SiftScience / sift-ios

Sift iOS SDK
MIT License
19 stars 26 forks source link

Sift iOS SDK

Integration guide

Here is how to integrate with Sift iOS SDK into your Objective-C iOS app project (for Swift projects the steps are pretty similar).

Installing the library

You may get the SDK into your iOS project through CocoaPods, Carthage and Swift Package Manager

Through CocoaPods:

Through Carthage:

Through Swift Package Manager:

Update for Xcode 11

Recommended steps:

Initializing the library

The SDK works in the background and so you have to initialize it when your app starts. It usually makes most sense to initialize the SDK in application:didFinishLaunchingWithOptions:.

Here is what you would do within AppDelegate.m:

Tracking users

Sift needs the user ID to track the user using this app. Once the user ID is available (for example, after user has logged in), please set the user ID:

[[Sift sharedInstance] setUserId:@"USER_ID"];

If a user logs out, unset the user ID by invoking:

[[Sift sharedInstance] unsetUserId];

License

The Sift iOS SDK is distributed under the MIT license. See the file LICENSE for details.

The Sift iOS SDK includes Charcoal Design's GZIP library, distributed under the permissive zlib license. See the files Sift/Vendor/NSData+GZIP.h and Sift/Vendor/NSData+GZIP.m for details.