Liquid SDK for iOS & Apple Watch

Overview

pod badge

Quick Start to Liquid SDK for iOS & Apple Watch

This document is just a quick start introduction to Liquid SDK for iOS. You can read the full documentation at https://www.onliquid.com/documentation/ios/.

To integrate Liquid in your app, just follow the simple steps below.

Install Liquid in your project (iOS)

  1. Install CocoaPods in your system

  2. Open your Xcode project folder and create a file called Podfile with the following content:

    pod 'Liquid'
  3. Run pod install and wait for CocoaPod to install Liquid SDK. From this moment on, instead of using .xcodeproj file, you should start using .xcworkspace.

Install Liquid in your project (watchOS)

To install Liquid for an watchOS project, you need to explicitly define the platform for each of your targets, in your Podfile, like shown below:

target 'Example' do
  platform :ios, '5.0'
  pod 'Liquid'
end

target 'ExampleApp WatchKit Extension' do
  platform :watchos, '2.0'
  pod 'Liquid'
end

target 'ExampleApp WatchKit App' do
  platform :watchos, '2.0'
  pod 'Liquid'
end

target 'Example TV App' do
  platform :tvos, '9.0'
  pod 'Liquid'
end

Start using Liquid

1. Initialize Liquid singleton

In your AppDelegate.m file initialize Liquid in application:willFinishLaunchingWithOptions: method:

#import <Liquid/Liquid.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
# ifdef DEBUG
    [Liquid sharedInstanceWithToken:@"YOUR-DEVELOPMENT-APP-TOKEN" development:YES];
# else
    [Liquid sharedInstanceWithToken:@"YOUR-PRODUCTION-APP-TOKEN"];
# endif
    // The rest of your code goes here...
}

2. Identify a user (optional)

If all your users are anonymous, you can skip this step. If not, you need to identify them and define their profile. Typically this is done at the same time your user logs in your app (or you perform an auto login), as seen in the example below:

[[Liquid sharedInstance] identifyUserWithIdentifier:@"UNIQUE-ID-FOR-USER"
                                         attributes:@{ @"gender": @"female",@"name":@"Anna Lynch" }];

The username or email are some of the typical user identifiers used by apps.

3. Track events

You can track any type of event in your app, using one of the following methods:

[[Liquid sharedInstance] track:@"clickedProfilePage"];

Or:

[[Liquid sharedInstance] track:@"boughtProduct" 
                    attributes:@{ @"productId": 123 }];

4. Configure Push Notifications and In-App Messages

To send Push Notifications or In-App Messages to your users' devices through Liquid formulas you just need to configure those three delegation methods:

// AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
    return YES;
}

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    [[Liquid sharedInstance] setApplePushNotificationToken:deviceToken];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [[Liquid sharedInstance] handleRemoteNotification:userInfo forApplication:application];
}

5. Personalize your app (with dynamic variables)

You can transform any old-fashioned static variable into a "Liquid" dynamic variable just by replacing it with a Liquid method. You can use a dynamic variable like this:

NSString *text = [[Liquid sharedInstance] stringForKey:@"welcomeText" 
                                              fallback:@"Welcome to our App"];

Full documentation

We recommend you to read the full documentation at https://www.onliquid.com/documentation/ios/.

Author

Liquid Data Intelligence, S.A.

License

Liquid is available under the Apache license. See the LICENSE file for more info.

Comments
  • Aspects and SocketRocket

    Aspects and SocketRocket

    Im getting this error after updating liquid using cocoapods: "SRWebSocket.h" not found.

    Apparently SocketRocket and Aspects are not being included.

    opened by diogoAntunes 5
  • Casual crashes when tracking an event after using `setUserAttribute:forKey:`

    Casual crashes when tracking an event after using `setUserAttribute:forKey:`

    [[Liquid sharedInstance] setUserAttribute:@24 forKey:@"age"];
    [[Liquid sharedInstance] track:@"Event Name"];
    

    Backtrace:

    Thread : Crashed: com.apple.main-thread
    
    0 libobjc.A.dylib 6875487184 objc_msgSend + 16
    1 CoreFoundation 6527230188 -[NSMutableDictionary addEntriesFromDictionary:] + 148
    2 Liquid 4297056976 -[LQUser jsonDictionary] (LQUser.m:51)
    3 Liquid 4297020496 -[LQDataPoint jsonDictionary] (LQDataPoint.m:63)
    4 Liquid 4297075948 -[Liquid track:attributes:allowLqdEvents:withDate:] (Liquid.m:513)
    5 Liquid 4297075224 -[Liquid track:attributes:allowLqdEvents:] (Liquid.m:463)
    6 Liquid 4295589304 -[NotificationManager didRegisterUserNotificationSettings:] (NotificationManager.m:75)
    7 Liquid 4295615268 -[AppDelegate application:didRegisterUserNotificationSettings:] (AppDelegate.m:188)
    8 libdispatch.dylib 6883776432 _dispatch_call_block_and_release + 24
    
    opened by miguelcma 0
  • Production vs Environment

    Production vs Environment

    The API is a bit awkward to be used:

    + (Liquid *)sharedInstanceWithToken:(NSString *)apiToken;
    + (Liquid *)sharedInstanceWithToken:(NSString *)apiToken development:(BOOL)development;
    

    Wouldn't it be preferable to do something along the lines of:

    + (Liquid *)sharedInstanceWithToken:(NSString *)apiToken environment:(LQEnvironment)environment;
    

    The LQEnvironment would be an enum, where the Development and Production could be stored.

    opened by RuiAAPeres 0
  • Freeze when returning from background without internet connection

    Freeze when returning from background without internet connection

    When returning from background quickly, Liquid's applicationDidEnterBackground: is executed, calling requestNewLiquidPackageSynced, blocking the main thread

    opened by CristianoCastroNabia 0
  • Minor change on Liquid Demo app interface

    Minor change on Liquid Demo app interface

    Move the anonymous user identifier into its own button, allowing one to identify an anonymous user multiple times successively. Also reuse the last segmented control discrete button to add a new identified user.

    This should allow more freedom on switching users and will allow us to replicate some bugs caused by edge case uses of the identify user with anonymous.

    opened by jasoares 0
  • Assert not allowed characters used in entity attributes

    Assert not allowed characters used in entity attributes

    Assert with NSAssert if a not allowed character is used in any attribute of any of the four Liquid main entities (User, Device, Session and Event).

    Not allowed characters are:

    • Dollar ($)
    • Dot (.)
    • Null character (\0)
    enhancement 
    opened by miguelcma 0
  • Add more flexibility to user identify methods

    Add more flexibility to user identify methods

    Previously supported methods:

    -(void)identifyUser;
    -(void)identifyUserWithIdentifier:(NSString *)identifier;
    -(void)identifyUserWithIdentifier:(NSString *)identifier attributes:(NSDictionary *)attributes;
    -(void)identifyUserWithIdentifier:(NSString *)identifier attributes:(NSDictionary *)attributes location:(CLLocation *)location;
    

    Added methods, to set attributes and location on auto identified users:

    -(void)identifyUserWithAttributes:(NSDictionary *)attribute;
    -(void)identifyUserWithAttributes:(NSDictionary *)attributes location:(CLLocation *)location;
    
    feature 
    opened by miguelcma 0
  • There seems to be an IB document that is set to earlier than iOS 7.0

    There seems to be an IB document that is set to earlier than iOS 7.0

    /* com.apple.ibtool.document.warnings / /Users/jlteruel/Github/WHS-iOS/Pods/Liquid/Liquid/Views/LQSlideUpMessage.xib:global: warning: This file is set to build for a version older than the deployment target. Functionality may be limited. [9] / com.apple.ibtool.document.errors */ /Users/jlteruel/Github/WHS-iOS/Pods/Liquid/Liquid/Views/LQSlideUpMessage.xib:global: error: Compiling IB documents for earlier than iOS 7 is no longer supported. [12]

    opened by patteruel-dev 0
  • Carthage Support

    Carthage Support

    Do you plan on supporting Carthage?

    We have some projects that are built in a way that makes CocoaPods impossible to use (using xcconfig files instead of targets, because managing too many targets (100+) that share the same code in XCode is a huge waste of time).

    Since Carthage is a lot less intrusive it is the best solution for our case. And we'd like to have your library in our Cartfile ;)

    opened by KTachyon 4
Releases(v2.3.3)
  • v2.3.3(Jul 19, 2016)

  • v2.3.2(May 10, 2016)

  • v2.3.1(Apr 20, 2016)

    • [bugfix] Use external libraries (Aspects and SocketRocket) as Cocoapods dependencies to avoid name colisions. (Note: original files are still included on the codebase to allow Liquid manual integration, but are excluded from Liquid Pod).
    • [bugfix] Fix a creash (while generating the Da* te HTTP Header) that could occur when multiple requests happen an the same time.
    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Apr 18, 2016)

    • [important] Minimum deployment target for iOS was increased from 5.0 to 6.0.
    • [feature] Event Tracking Mode: allow publishers to add/change/remove events to buttons directly on the App (and Liquid dashboard). Yup, without coding ;)
    • [feature] In-App Notifications are now sent via push notifications, allowing event-based notifications (and not only when the app is open).
    • [feature] Users with "dates in the future" or "dates in the past" (with the wrong hour and date set on their phone clocks) are now automatically fixed for the correct date.
    • [bugfix] Release Version and App Version device attributes were switched.
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Mar 17, 2016)

  • v2.1.1(Feb 16, 2016)

    • [enhancement] Add a method to automatically handle deep linking in push notifications: handleRemoteNotification:forApplication:, intended to be called when a push nofification is received by AppDelegate.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Feb 9, 2016)

    2.1.0: Stable new SDK release supporting Liquid 2.0

    • [feature] In-app messages. Notice that you will need to upgrade if you are still using 1.x.
    • [feature] Add support for Apple Watch.
    • [feature] Adjustable sessions. Remove session handling by the SDK. Sessions are now managed by Liquid servers. You can now define the maximum time between sessions in your App settings on Liquid Dashboard. This feature also improves better handling of events performed while the app is in background.
    • [enhancement] Event names generated by Liquid changed from _startSession and _endSession to app foreground and app background respectively.
    • [enhancement] Stability improvements.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0-rc5(Feb 2, 2016)

    • [feature] Remove session handling by the SDK. Sessions are now managed by Liquid servers. You can now define the maximum time between sessions in your App settings on Liquid Dashboard. This feature also improves better handling of events performed while the app is in background.
    • [enhancement] Stability improvements for in-app messages
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0-rc4(Dec 7, 2015)

  • v2.1.0-rc3(Dec 2, 2015)

  • v1.2.3(Dec 1, 2015)

    • [enhancement] Do not create a session when the app is open in background. This avoids creating huge sessions that are open in background and only closed when the app goes foreground.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0-rc2(Nov 30, 2015)

    • [enhancement] Do not create a session when the app is open in background. This avoids creating huge sessions that are open in background and only closed when the app goes foreground.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0-rc1(Nov 30, 2015)

  • v2.0.0-rc2(Nov 30, 2015)

    • [bugfix] Small fix that could avoid compiling on iOS < 9
    • [feature] [iOS >= 6.0] Add support for Modal In-App Messages.
    • [feature] [iOS >= 6.0] Add support for Banner n-App Messages.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Nov 3, 2015)

    • [bugfix] Avoid a race condition in certain situations, while changing a user attribute with setUserAttribute:forKey: or while setting the device location with setCurrentLocation:.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Sep 21, 2015)

    • [fix warning] Change deprecated NSGregorianCalendar to NSCalendarIdentifierGregorian.
    • [fix warning] Always use arc4random_uniform (instead of arc4random) to generate random values.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jun 17, 2015)

  • v1.1.1(Jun 17, 2015)

  • v1.1.0(Jun 17, 2015)

    • [feature] Identifying a user no longer starts a new session.
    • [feature] Calling resetUser: on a nonymous user no longer creates a new Unique ID, to avoid creating more anonymous users than desired.
    • [feature] Device Unique ID is now stored in Keychain also, to remain the same when the app is uninstalled and reinstalled again. Furthermore, if NSUserDefaults are reset, device ID remains the same. Detailed explanation at this blog post.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Oct 15, 2014)

    We're proud to announce Liquid v1.0 of the iOS SDK. We’ve been improving it with more functionalities, guaranteeing in all versions that all the data points are correctly created and tracked. We want to thank to everyone that contributed to this release, with pull requests, tracking of issues and suggestions.

    Source code(tar.gz)
    Source code(zip)
  • v0.9.4-beta(Oct 15, 2014)

    • [bugfix] Fix an issue that could cause some dates to be incorrectly serialized (to JSON) to the ISO8601 format in some system locales/regions.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.3-beta(Sep 23, 2014)

    • [enhancement] Lots of speed and stability improvements
    • [enhancement] Improvements on log messages
    • [bugfix] When the app goes on background and foreground again, the request of a Liquid Package could be locking the main thread. Thanks @CristianoCastroNabia for the bug report.
    • [bugfix] Some events were not reaching the server on rare occasions.
    • [bugfix] When an anonymous user was aliased with an identified user, some events could still be tracked as having been done by the previous user.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.2-beta(Aug 27, 2014)

  • v0.9.1-beta(Jul 24, 2014)

  • v0.9.0-beta(Jul 23, 2014)

    • [feature] Add support to alias anonymous users with identified users.
    • [feature] Anonymous users are now automatically handled. If you never identify your user, all activity will be tracked anonymously. As soon as an user is identified, all that anonymous activity will be automatically aliased to the identified user.
    • [feature] When a user is identified, it is kept in cache for the next launch. This means that you don't need to identify each time you start the app again.
    • [bugfix] Fix a problem on HTTP Requests queue, that could cause duplication or loss of events.
    • [bugfix] Fix a bug that could cause a bad access and a crash under edge cases, while loading new values for Liquid variables too often.
    • [enhancement] Improvements on demo app.
    • [enhancement] Better handling of background and foreground events.
    • [enhancement] Speed and stability improvements.
    • [enhancement] Improvements on event tracking dates that avoid two events tracked too quickly to be tracked in the wrong order.
    • [enhancements] The use of reserved names on Users and Events attributes will raise an assert under development environment (skipped/ignored attributes in production).
    • [change] Changed Device attributes from camelCase to underscore naming convention, and removed _ prefix (e.g: attribute _systemVersion was changed to system_version). This will not affect your queries on Liquid dashboard.
    • [change] Renamed device_model and device_name attributes to model and name on Device entity. This will not affect your queries on Liquid dashboard.
    • [deprecate] Method flushOnBackground: was deprecated. When the app goes on background, HTTP queue is always flushed.
    Source code(tar.gz)
    Source code(zip)
  • v0.8.1-beta(Jun 22, 2014)

    • [enhancement] Fixes a Xcode compilation error that occured when Liquid is integrated using the "Liquid Project" method
    • [enhancement] Under-the-hood small refactoring on Liquid Demo App
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0-beta(Jun 19, 2014)

    • [feature] Added Kiwi tests/specs for the most important Liquid components (use Liquid.xcworkspace in order to run them).
    • [feature] A Demo App is now available on Liquid Project (at both Liquid.xcodeproj and Liquid.xcworkspace) to ease the integration by new developers.
    • [feature] A new NSNotification and LiquidDelegate is availabe to inform developers that a user was identified on Liquid SDK.
    • [feature] Two new methods to get current entity identifiers: deviceIdentifier: and sessionIdentifier: (beyond the already existing userIdentifier:)
    • [enhancement] Many stability important improvements that avoid race conditions. A lot of integration tests were created to guarantee this stability.
    • [enhancement] In development mode, fatal Liquid configuration errors are now asserts instead of simple console logs. In production, console logs were kept.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.2-beta(May 27, 2014)

  • v0.7.1-beta(May 27, 2014)

  • v0.7.0-beta(Jun 20, 2014)

    • [feature] iOS 5 is now supported.
    • [feature] Added a new method for SDK integration: Liquid Xcode Project.
    • [feature] Invalid characters on attributes and invalid event names now raise a NSAssert message
    • [enhancement] Many performance improvements on HTTP requests queue
    • [enhancement] CLLocation information is now sent to Device entity, and not User entity
    • [deprecate] identifyUserWithIdentifier:attributes:location: -> Use identifyUserWithIdentifier:attributes: instead, and setCurrentLocation: in separate methods.
    • [deprecate] setUserLocation: -> Use setCurrentLocation: instead
    • [fix] Fixes a bug that could crash the app when the app is open and closed very fast
    • [fix] HTTP queue is now a circular queue (FIFO), privileging most recent events
    Source code(tar.gz)
    Source code(zip)
Owner
Liquid
Automated formulas to increase mobile app engagement, retention and monetisation.
Liquid
Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter 45 Nov 29, 2022
Official Appwrite SDK for Apple Devices 🍎

Appwrite Apple SDK This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check previous releases. Appwrite is an open

Appwrite 55 Jan 2, 2023
Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK

RadarCOVID iOS App Introduction Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK Prerequisites These are the tools used to bu

Radar COVID 146 Nov 24, 2022
TelegramStickersImport — Telegram stickers importing SDK for iOS

TelegramStickersImport — Telegram stickers importing SDK for iOS TelegramStickersImport helps your users import third-party programaticaly created sti

null 35 Oct 26, 2022
Muxer used on top of Feed iOS SDK for airplay

FeedAirplayMuxer Muxer used on top of Feed iOS SDK for airplay purposes. Demo Project --> https://github.com/feedfm/AirplayDemo Feed Airplay Muxer is

Feed Media 0 May 6, 2022
Basispay IOS SDK Version 2

BasisPay-IOS-KIT BasisPay IOS Payment Gateway kit for developers INTRODUCTION This document describes the steps for integrating Basispay online paymen

null 0 Oct 21, 2021
Release repo for Gini Bank SDK for iOS

Gini Bank SDK for iOS The Gini Bank SDK provides components for capturing, reviewing and analyzing photos of invoices and remittance slips. By integra

Gini GmbH 1 Dec 6, 2022
Da Xue Zhang Platform Lvb iOS SDK

Cloud_Lvb_SDK iOS API Reference Dxz Meeting iOS SDK是为 iOS 平台用户音视频服务的开源 SDK。通过大学长开放平台自研RTC,RTM系统,为客户提供质量可靠的音视频服务。 类 类名 描述 CLS_PlatformManager SDK的音视频主要

null 8 Jan 10, 2022
PayPal iOS SDK

PayPal iOS SDK Welcome to PayPal's iOS SDK. This library will help you accept card, PayPal, Venmo, and alternative payment methods in your iOS app. Su

PayPal 25 Dec 14, 2022
Unofficial Notion API SDK for iOS & macOS

NotionSwift Unofficial Notion SDK for iOS & macOS. This is still work in progress version, the module interface might change. API Documentation This l

Wojciech Chojnacki 59 Jan 8, 2023
150,000+ stickers API & SDK for iOS Apps.

English | 한국어 Stipop UI SDK for iOS Stipop SDK provides over 150,000 .png and .gif stickers that can be easily integrated into mobile app chats, comme

Stipop, Inc. 19 Dec 20, 2022
Spotify SDK for iOS

Spotify iOS SDK Overview The Spotify iOS framework allows your application to interact with the Spotify app running in the background on a user's devi

Spotify 522 Jan 6, 2023
Headless iOS/Mac SDK for saving stuff to Pocket.

This SDK is deprecated Howdy all! ?? Thanks for checking out this repo. Your ?? mean a lot to us. ?? Unfortunately, this project is deprecated, and th

Pocket 230 Mar 18, 2022
Evernote Cloud SDK for iOS

Evernote Cloud SDK 3.0 for iOS This is the official Evernote SDK for iOS. To get started, follow the instructions bellow. Additional information can b

Evernote 256 Oct 6, 2022
iOS SDK for the Box Content API

Box iOS SDK Getting Started Docs: https://developer.box.com/guides/mobile/ios/quick-start/ NOTE: The Box iOS SDK in Objective-C (prior to v3.0.0) has

Box 112 Dec 19, 2022
OneDrive SDK for iOS

Get started with the OneDrive SDK for iOS Integrate the OneDrive API into your iOS app! 1. Installation Install via Cocoapods Install Cocoapods - Foll

OneDrive 101 Dec 19, 2022
Stripe iOS SDK

Stripe iOS SDK The Stripe iOS SDK makes it quick and easy to build an excellent payment experience in your iOS app. We provide powerful and customizab

Stripe 1.8k Jan 5, 2023
AWS SDK for iOS. For more information, see our web site:

AWS SDK for iOS The AWS SDK for iOS provides a library and documentation for developers to build connected mobile applications using AWS. Features / A

AWS Amplify 1.6k Dec 26, 2022
Zendesk Mobile SDK for iOS

⚠️ This Repository has been deprecated, please go to here for the Zendesk Support SDK ⚠️ Zendesk Mobile SDK for iOS Zendesk SDK for mobile is a quick,

Zendesk 113 Dec 24, 2022