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

  1. Add the SDK to your Podfile:

pod 'Blitzllama-ios', '1.6.29'
  1. Install the pods:

pod install

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):

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
    }
}

3. Create a User

Ensure you create a user with a unique user ID before triggering surveys to avoid duplicate survey prompts:

BlitzLlamaSDKController.getSDKManager.createUser("user_id")

4. Trigger a Survey

Add a trigger in your app (e.g., on a button press or screen load) to display surveys:

BlitzLlamaSDKController.getSDKManager.fetchSurvey(triggerName: "triggerName")

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)

// coming soon

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".

BlitzLlamaSDKController.getSDKManager.updateUserAttributes("attribute_name", attributeValue: "attribute_value", dataType: "string")  

Set User Email or Name (Optional)

Providing the user’s email or name is optional but can help personalize surveys.

BlitzLlamaSDKController.getSDKManager.updateUserEmail("user_email")
BlitzLlamaSDKController.getSDKManager.updateUserName("user_name")

Setting Survey Language

Set the survey language using an ISO 639-1 codes (e.g., "en" for English).

BlitzLlamaSDKController.getSDKManager.setLanguageCode("en")

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:

BlitzLlamaSDKController.getSDKManager.logout()

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 the fetchSurvey 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