iOS
Overview
The Blitzllama iOS SDK enables you to deliver in-product surveys directly inside your iOS app. By integrating the SDK, you can collect targeted user feedback at critical moments in the user journey.
Key Features:
Quickly embed surveys via triggers you define in your app.
Identify and track users to ensure they don’t receive duplicate surveys unnecessarily.
Personalize surveys with user attributes (optional).
Localize surveys by setting different languages (optional).
Requirements:
iOS 11 and above
Access to the Blitzllama dashboard (to retrieve your API key and manage triggers).
Getting Started
Before You Begin
Obtain Your API Key:
Log in to the Blitzllama dashboard, navigate to the Connections Tab, click iOS, and find your API_KEY
.
Quick Start (5 Minutes)
1. SDK Installation
Option A: Cocoapods (Recommended)
Add the SDK to your Podfile:
Install the pods:
Option B: Swift Package Manager (SPM)
In Xcode, go to File > Add Packages.
Use the Blitzllama iOS SDK git repository.
Select the latest version from he master branch and add it to your project targets.
2. Initializing the SDK
In your AppDelegate
(or SceneDelegate
if using newer lifecycle):
3. Create a User
Ensure you create a user with a unique user ID before triggering surveys to avoid duplicate survey prompts:
4. Trigger a Survey
Add a trigger in your app (e.g., on a button press or screen load) to display surveys:
Make sure the trigger name matches the configuration on the Blitzllama dashboard.
You’re now ready to collect targeted user feedback with Blitzllama’s in-app surveys! 🚀
Triggers and Event Properties
What are Triggers?
Triggers are events in your app (e.g., button presses, screen views) that prompt a survey if configured in the Blitzllama dashboard.
Adding Trigger Properties (Optional)
Why Use Trigger Properties?
Filter users more precisely in the Blitzllama dashboard.
Understand user context when surveys are triggered.
You can also use backend events to launch in-app surveys. Check out https://documentation.blitzllama.com/connections/backend-trigger for more details.
Personalizing and Localizing Surveys
Setting User Attributes
Attributes help you segment and target specific user groups. Allowed data types are "string"
, "number"
, "date"
, "boolean"
.
Set User Email or Name (Optional)
Providing the user’s email or name is optional but can help personalize surveys.
Setting Survey Language
Set the survey language using an ISO 639-1 codes (e.g., "en"
for English).
Why Set Survey Language?
Improve user experience by displaying surveys in the user's native language.
Better localization for multi-lingual apps.
User Management
Logout User
When a user logs out, call the logout method to clear their session:
Why Logout?
Prevents mixing user data between sessions.
Ensures a clean state when switching users.
FAQ & Troubleshooting
Survey not showing up?
Ensure
createUser
is called before triggering an event.Check that the trigger name matches exactly what’s configured in the Blitzllama dashboard.
Survey not showing on the first screen?
This might be due to timing issues. Consider delaying the trigger call until after
createUser
completes.
Switching users?
Call
logout()
before creating a new user to avoid mixing sessions.
How to create triggers?
Add a new
trigger_name
in your app. If it doesn’t exist, it’s automatically created and will appear on the dashboard.Alternatively, create the trigger on the Blitzllama dashboard first, then use the same
trigger_name
in thefetchSurvey
call.
Need more help?
Reach out via support chat or email
tech@blitzllama.com
.
Next Steps
Start by adding 5 triggers for the most critical user actions in your app.
Create your first survey on the Blitzllama dashboard.
Customize the UI/UX of the survey on the Blitzllama dashboard.
Last updated