Integrating Intercom SDK for Mobile App Support
Intercom differs from Zendesk and Freshdesk because it was originally designed as a product engagement platform—with targeted in-app messages, onboarding tours, and automated chatbots (Fin AI). When you need to actively guide users rather than just respond to requests—Intercom usually wins.
Installation and Initialization
iOS
// Podfile
pod 'Intercom'
// AppDelegate
import Intercom
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Intercom.setApiKey("ios_sdk-...", forAppId: "your_app_id")
return true
}
Intercom doesn't fully support Swift Package Manager for dynamic frameworks on iOS—only CocoaPods or Carthage. This first surprises developers accustomed to SPM.
Android
// build.gradle.kts
implementation("io.intercom.android:intercom-sdk:15.x.x")
// Application.onCreate()
Intercom.initialize(this, "android_sdk-...", "your_app_id")
User Identification
Intercom supports two modes: anonymous (for logged-out) and identified with HMAC verification.
// iOS: authenticated user
let attrs = ICMUserAttributes()
attrs.userId = "user_12345"
attrs.email = "[email protected]"
attrs.name = "John Doe"
// Custom attributes for segmentation
attrs.customAttributes = [
"plan": "premium",
"signup_date": Date()
]
Intercom.loginUser(with: attrs) { result in
switch result {
case .success: break
case .failure(let error): print(error)
}
}
HMAC verification is mandatory in production. Without it, any user can spoof userId and access another's conversation history. Backend generates HMAC:
Intercom.setUserHash("backend_generated_hmac_string")
Generation on backend (Node.js):
const crypto = require('crypto');
const hash = crypto.createHmac('sha256', process.env.INTERCOM_SECRET)
.update(userId)
.digest('hex');
Messenger and In-App Messages
Opening chat:
Intercom.present() // entire Messenger
Intercom.presentMessageComposer(nil) // new message directly
Intercom.presentContent(.helpCenter) // Help Center only
In-App messages (banners, modals) show automatically based on rules in Intercom Console—require no client code, just proper user identification.
Hiding Launcher
By default, Intercom shows a floating button. In most apps, this is unwanted—custom entry point needed:
// Hide standard launcher
Intercom.setLauncherVisible(false)
// Custom support button
@IBAction func supportTapped(_ sender: UIButton) {
Intercom.present()
}
Push Notifications
// Register APNs token
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Intercom.setDeviceToken(deviceToken)
}
// Handle incoming push
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
if Intercom.isIntercomPushNotification(response.notification.request.content.userInfo) {
Intercom.handlePushNotification(response.notification.request.content.userInfo)
}
completionHandler()
}
Push from Intercom comes through APNs, but payload contains intercom key—check before handling to avoid conflicts with Firebase Messaging.
Conflicts with Other SDKs
Both Intercom and Firebase Messaging set UNUserNotificationCenterDelegate. Need a single delegate routing push:
// AppDelegate
func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
let userInfo = notification.request.content.userInfo
if Intercom.isIntercomPushNotification(userInfo) {
completionHandler([])
} else {
// Firebase or other handler
completionHandler([.banner, .sound])
}
}
Timeline Estimates
Basic integration with chat, identification, and push—3–5 days. Custom event setup for segmentation, in-app message testing, and HMAC verification on staging—plus 1–2 days.







