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
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.
- π 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
- Requirements
- Installation
- Quick Start
- Configuration
- API Reference
- Migration Guide
- Example Project
- Support
| Requirement | Minimum Version |
|---|---|
| iOS | 15.0+ |
| Swift | 5.9+ |
| Xcode | 15.0+ |
Choose one of the following installation methods:
Add the following to your Podfile:
pod 'CustomerPulseSDK', '~> 2.0'
Then run:
pod install
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") ]
- Download
CustomerPulse.xcframeworkfrom the Releases page - Drag and drop it into your Xcode project
- Ensure it's added to "Frameworks, Libraries, and Embedded Content" with "Embed & Sign"
import CustomerPulselet pulse = CustomerPulse(appId: "YOUR_APP_ID", token: "YOUR_TOKEN")
pulse.showSurvey(on: self)
That's it! π
Switch between production and sandbox environments:
// Production (default) CustomerPulse.environment = .production // Sandbox (for testing) CustomerPulse.environment = .sandbox
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
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 | [:] |
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!") } }
For complete API documentation, see docs/API.md.
// 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:)
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 yourimport CustomerPulsestatements stay the same.
| 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+ |
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)
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)
Check out the example project in the example/ directory for a complete implementation.
cd example/CustomerPulseSample
open CustomerPulseSample.xcworkspace- π Documentation: API Reference
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Issues
- π§ Email: mohamed@kalvad.com
See CHANGELOG.md for a list of changes in each version.
Made with β€οΈ by Kalvad Tech