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
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.4.5'
Then run this command in the same directory that contains your Podfile.
pod install
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
}
}
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.
BlitzLlamaSDKController.getSDKManager.createUser(user_id)
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)
You can provide Blitzllama with the user's email address. Email address is not mandatory for iOS micro-surveys.
BlitzLlamaSDKController.getSDKManager.updateUserEmail(email)
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)
You can provide Blitzllama with the language you wish to survey your user. It is not mandatory to launch surveys.
BlitzLlamaSDKController.getSDKManager.setLanguageCode("en")
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(viewController: self, 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.
Last modified 3d ago