iOS

The three main sections here are:

  • Integrating the SDK: retrieving and adding the SDK to your project

  • Managing Users: creating a new user and setting user attributes

  • Adding Triggers: add triggers in critical components inside your app to initiate the micro-surveys

1. Install SDK

a) Install via Cocoapods

The recommended way to acquire this Framework is via CocoaPods. Add the following statement to your Podfile, then run pod install:

pod 'Blitzllama-ios', '1.6.5'

Then run this command in the same directory that contains your Podfile.

pod install

b) Install via SPM

To install using Blitzllama SDK via SPM, use our release git repository and install the package from the master branch

Initializing the SDK

API_KEY can be found on the Connections > iOS page on the Blitzllama dashboard.

import BlitzLlamaSDK
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        //initialisation Blitzllama
        BlitzLlamaSDKController.getSDKManager.setBlitzLlamaAPIKey(API_KEY)
        return true
    }
}

2. Managing Users

Create User

It is mandatory to create users using unique user_ids. Not only does it provide a consistent experience across platforms, but also prevents users from being surveyed multiple times.

Create a user with a unique user_id to prevent any inconsistencies.

Call the logout function or clear storage, if you are switching between projects in the same device.

BlitzLlamaSDKController.getSDKManager.createUser(user_id)

Logout User

BlitzLlamaSDKController.getSDKManager.logout()

Update User Attributes (optional)

Attributes are additional data points about users, that are used for creating targeted user cohorts on the Blitzllama dashboard. Attributes are optional and not required to launch a micro-survey.

Allowed data_type values are "string", "number", "date", and "boolean".

BlitzLlamaSDKController.getSDKManager.updateUserAttributes(attribute, attributeValue, dataType) 

Update User Email (optional)

You can provide Blitzllama with the user's email address. Email address is not mandatory for iOS micro-surveys.

BlitzLlamaSDKController.getSDKManager.updateUserEmail(email)

Update User Name (optional)

You can also provide Blitzllama with the user's name. It can be used to make the questions more personalised. The user name is, again, not mandatory to launch surveys.

BlitzLlamaSDKController.getSDKManager.updateUserName(username)

Set User Language (compulsory)

You can provide Blitzllama with the language you wish to survey your user. It is not mandatory to launch surveys.

BlitzLlamaSDKController.getSDKManager.setLanguageCode("en")

Language code should be in ISO 639-1 codes.

3. Adding Triggers

Triggers, when initiated, display the micro-survey to the users. You can add triggers to all components - button press, screen open or screen close - that are critical in a user's journey.

Make sure to create a user before triggering a survey.

BlitzLlamaSDKController.getSDKManager.fetchSurvey(triggerName: triggerName)

Make sure the trigger_name correctly matches the trigger name on the Blitzllama dashboard

You can also use backend events to launch in-app surveys. Check out https://documentation.blitzllama.com/connections/backend-trigger for more details.

Releases

v1.5.4

Image Question Support

Last updated