Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

KalvadTech/CustomerPulse-ios

Repository files navigation

CustomerPulse iOS SDK

Easily integrate CustomerPulse surveys into your iOS applications
Explore the API docs Β»

Report Bug Β· Request Feature

Platform iOS 15.0+ Swift 5.9+ CocoaPods compatible License MIT Version 2.0.0


Overview

CustomerPulse iOS SDK provides a simple and elegant way to display customer satisfaction surveys in your iOS applications. With just a few lines of code, you can gather valuable feedback from your users.

Features

  • πŸš€ Simple Integration - Get started with just 3 lines of code
  • πŸ”’ Secure - All communications over HTTPS
  • 🌍 Multi-language Support - Built-in support for English and Arabic
  • 🎨 Native Experience - Surveys displayed in a native WKWebView
  • πŸ”§ Configurable - Environment switching, dismissal control, auto-close timing
  • πŸ“Š Debug Mode - Built-in logging for development

Table of Contents


Requirements

Requirement Minimum Version
iOS 15.0+
Swift 5.9+
Xcode 15.0+

Installation

Choose one of the following installation methods:


Option 1: CocoaPods (Recommended)

Add the following to your Podfile:

pod 'CustomerPulseSDK', '~> 2.0'

Then run:

pod install

Option 2: Swift Package Manager

In Xcode, go to File β†’ Add Package Dependencies and enter:

https://github.com/KalvadTech/CustomerPulse-ios.git

Or add the following to your Package.swift:

dependencies: [
 .package(url: "https://github.com/KalvadTech/CustomerPulse-ios.git", from: "2.0.0")
]

Option 3: Manual Installation

  1. Download CustomerPulse.xcframework from the Releases page
  2. Drag and drop it into your Xcode project
  3. Ensure it's added to "Frameworks, Libraries, and Embedded Content" with "Embed & Sign"

Quick Start

1. Import the SDK

import CustomerPulse

2. Initialize

let pulse = CustomerPulse(appId: "YOUR_APP_ID", token: "YOUR_TOKEN")

3. Show Survey

pulse.showSurvey(on: self)

That's it! πŸŽ‰


Configuration

Environment

Switch between production and sandbox environments:

// Production (default)
CustomerPulse.environment = .production
// Sandbox (for testing)
CustomerPulse.environment = .sandbox

Debug Logging

Enable console logging during development:

CustomerPulse.debugLogging = true

Output:

[CustomerPulse] SDK initialized with appId: YOUR_APP_ID
[CustomerPulse] Environment: sandbox
[CustomerPulse] Loading survey: https://sandboxsurvey.customerpulse.gov.ae/TOKEN
[CustomerPulse] Survey completed

Survey Options

Customize survey behavior:

pulse.showSurvey(
 on: self,
 isDismissible: true, // Allow user to dismiss
 dismissAfter: 2000, // Auto-close after 2 seconds
 options: ["lang": "ar"] // Arabic language
)
Parameter Type Description Default
on UIViewController Presenting view controller Required
isDismissible Bool User can swipe to dismiss true
dismissAfter Int Auto-dismiss delay (ms) 1000
options [String: Any] Additional parameters [:]

Delegate

Handle survey completion events:

class MyViewController: UIViewController, CustomerPulseDelegate {
 let pulse = CustomerPulse(appId: "APP_ID", token: "TOKEN")
 override func viewDidLoad() {
 super.viewDidLoad()
 pulse.delegate = self
 }
 func csUserCompletedSurvey() {
 // User finished the survey
 print("Thank you for your feedback!")
 }
}

API Reference

For complete API documentation, see docs/API.md.

Quick Reference

// Static Properties
CustomerPulse.environment: Environment // .production or .sandbox
CustomerPulse.debugLogging: Bool // Enable/disable logging
// Instance Properties
pulse.delegate: CustomerPulseDelegate? // Completion callback delegate
// Methods
pulse.showSurvey(on:isDismissible:dismissAfter:options:)

Migration Guide

Upgrading from v1.x to v2.0

CocoaPods Name Change

The CocoaPods package has been renamed from CustomerPulse to CustomerPulseSDK.

Update your Podfile:

# Old (v1.x)
pod 'CustomerPulse'
# New (v2.0)
pod 'CustomerPulseSDK', '~> 2.0'

Note: The Swift module name remains CustomerPulse, so your import CustomerPulse statements stay the same.

Breaking Changes

v1.x v2.0
pod 'CustomerPulse' pod 'CustomerPulseSDK'
CustomerPulse("id", "token") CustomerPulse(appId: "id", token: "token")
dimissAfter: dismissAfter:
withOptions: options:
showSurveyWithBaseUrl(...) CustomerPulse.environment = .sandbox
iOS 13.0+ iOS 15.0+

Before (v1.x)

let sdk = CustomerPulse.init("APP_ID", "TOKEN")
sdk.showSurvey(on: self, dimissAfter: 1000, withOptions: ["lang": "en"])
// Sandbox
sdk.showSurveyWithBaseUrl(on: self, baseURL: "https://sandbox...", dimissAfter: 1000)

After (v2.0)

let sdk = CustomerPulse(appId: "APP_ID", token: "TOKEN")
sdk.showSurvey(on: self, dismissAfter: 1000, options: ["lang": "en"])
// Sandbox
CustomerPulse.environment = .sandbox
sdk.showSurvey(on: self, dismissAfter: 1000)

Example Project

Check out the example project in the example/ directory for a complete implementation.

cd example/CustomerPulseSample
open CustomerPulseSample.xcworkspace

Support


Changelog

See CHANGELOG.md for a list of changes in each version.


Made with ❀️ by Kalvad Tech

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /