Pulse Insights Documentation
  • Pulse Insights Overview
    • 👋Welcome to Pulse Insights
  • Implementing Pulse Insights (Dev)
    • Implementing on Web and Mobile Web
      • Deploying your tag (code snippet)
      • Ingesting contextual data for targeting and analysis
      • Client Key
      • Tracking Events (aka High Value Actions)
      • Presenting a specific survey
      • Supporting Inline surveys
      • Callbacks
      • Privacy Features
        • Identifiers, cookies, and local storage
        • Data that Pulse Insights stores
      • QA Process and Preview Mode
        • JavaScript Object
      • Single Page Apps
      • Load Time & Availability
      • Bot blocking
      • Customer-initiated Feedback
    • Implementing in email
      • Dynamic Email
    • Implementing in Native Apps
      • Android
        • Android Release Notes
        • Android Demo App
      • iOS
        • iOS Release Notes
        • iOS Demo App
      • Demo App Help
  • Integrations
    • Integrations overview
      • Hubspot
      • Braze
      • Google Analytics
      • Data Lake
  • Configuring Pulse Insights (Console)
    • Account Setup
      • Authentication & SSO
      • Inviting Collaborators
      • Roles & permissions
    • Dashboard & Program Management
      • Survey Status
    • Editor
      • Question Types
        • Survey Invitation
        • Single Choice
          • Using Images
        • Multiple Choice
        • Free Text
        • Net Promoter Score
        • Slider
        • Custom Content (Next Best Action)
        • Thank You Message
          • Poll (Show Results)
      • General
      • Targeting
        • Devices & Channels
        • Sample Rate
        • URL & Events
        • Dates
        • Previous Responses
        • On Page Behavior
        • CRM Targeting
        • Geo Targeting
        • Goal
        • User Behavior
        • Advanced Settings
      • Formatting
        • Widget Types
          • Docked
          • Bottom Bar
          • Top Bar
          • Overlay
          • Inline
        • Themes
        • Question Display
        • Custom CSS (Survey-level)
        • Supported Markdown
      • Link Builder
      • Preview
      • Survey Groups (Localization)
    • Reporting
      • Results Page & Filtering
      • On Demand
        • Columns/Data Dictionary
      • Scheduled Reports
      • Free Text
        • AI Generated Summary
        • Responses & Tagging
      • Custom Content Reporting
      • Viewable Impressions
    • Account Level Settings
      • Get Code Snippet
      • Global Targeting
      • Data & Integrations (Callbacks)
      • Data Restrictions
      • Themes
      • Automations
        • High Value Actions (Events)
      • Activity Log
      • Configured by Pulse Insights
  • Best Practices
    • Best Practices
      • Copy
      • Design and Execution
      • Targeting
      • Widget Types
      • Sample Rate
      • Submission Rates
      • Special Features
      • Best Practices for Progressive Profiling
  • API
    • API reference
      • Surveys
        • Questions
        • Poll
      • Q
        • A
      • Direct serve
      • Serve
      • Results
      • Present results
      • Track event
      • Custom content link click
      • Submissions
        • All answers
        • Answer
        • Close
        • Viewed at
      • Devices
        • Set data
Powered by GitBook
On this page
  • Pulse Insights iOS SDK Demo app
  • Getting Started
  • Usage
  • Features Demonstrated in the App
  • Documentation
  • License

Was this helpful?

  1. Implementing Pulse Insights (Dev)
  2. Implementing in Native Apps
  3. iOS

iOS Demo App

PreviousiOSNextDemo App Help

Was this helpful?

Pulse Insights iOS SDK Demo app

This demo application showcases the integration and usage of the for iOS. It demonstrates various features including survey triggering, context data management, and client key configuration.

Getting Started

Prerequisites

Xcode 14.0+ iOS 13.0+ Swift 5.0+

Installation

  1. Clone this repository

  2. Open the project in Xcode

  3. Build and run the application on your device or simulator

Usage

Step 1: Obtain an Account ID

First, you need to obtain an Account ID from the Pulse Insights Console:

  1. Log in to your Pulse Insights Console

  2. Navigate to Account Settings

  3. Copy your Account ID

Step 2: Initialize the SDK

In AppDelegate.swift, initialize the PulseInsights SDK with your Account ID:

import UIKit
import PulseInsights

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var pulseInsights: PulseInsights?

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        // Initialize PulseInsights with your Account ID
        let accountId = "YOUR_ACCOUNT_ID"
        pulseInsights = PulseInsights(accountId, enableDebugMode: true)
        
        // Optional: Set custom host if needed
        // pulseInsights?.setHost("survey.pulseinsights.com")
        
        // Optional: Set custom data
        let customData = ["user_type": "tester", "platform": "iOS"]
        pulseInsights?.setContextData(customData)
        
        return true
    }
}

Step 3: Trigger Surveys

To trigger surveys in your application:

// In your view controller
import PulseInsights

class YourViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Set the view name for targeting
        PulseInsights.getInstance.setViewName("mainView", controller: self)
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        // Serve the survey
        PulseInsights.getInstance.serve()
    }
}

Step 4: Set Client Key (Optional)

If you need to set a client key for specific surveys:

// Set the client key
PulseInsights.getInstance.setClientKey("YOUR_CLIENT_KEY")

Step 5: Manage Context Data (Optional)

You can add context data to provide additional information for survey targeting:

// Add context data
let contextData = ["user_id": "12345", "subscription_level": "premium"]
PulseInsights.getInstance.setContextData(contextData)

// Clear context data
PulseInsights.getInstance.clearContextData()

Features Demonstrated in the App

  • Survey triggering in different views

  • Inline surveys

  • Context data management

  • Client key configuration

  • Survey response checking

  • Device ID reset

Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

For more detailed information about the PulseInsights SDK, please refer to the .

PulseInsights SDK
official documentation