The Intercom iOS SDK supports iOS 7.x and iOS 8.x.
Remark: If you have an app that supports iOS 6, you can use the old version of the Intercom iOS SDK.
Add the Intercom pod into your Podfile
pod 'Intercom'
- Add
Intercom.h
andlibIntercom.a
to your Xcode project (you can get them from GitHub). In your build target, include the-ObjC
flag underOther Linker Flags
. - Make sure you are linking the following frameworks: ImageIO, MobileCoreServices, SystemConfiguration, AVFoundation. If you get errors, check out our Troubleshooting section here.
- You'll need your Intercom App Id and the SDK API key and you can get them from your Intercom App Settings -> API keys. The SDK API key should start with 'ios_sdk...'. If you only see keys starting with 'ios-...', check out our Troubleshooting section here.
- Initialize Intercom by calling:
[Intercom setApiKey:@"ios_sdk-..." forAppId:@"your_app_id"];
- Start a session by either calling
[Intercom beginSessionForUserWithEmail:self.dataSource.email
completion:^(NSError *error) {
// check the error object: only if we have no error, we have an active session and we can
// allow other Intercom calls (such as updating a user)
if (!error) {
// handleBeginSessionOK
} else {
// handleBeginSessionWithError:error
}
}];
or
[Intercom beginSessionForUserWithUserId:self.dataSource.userId
completion:^(NSError *error) {
// check the error object: only if we have no error, we have an active session and we can
// allow other Intercom calls (such as updating a user)
if (!error) {
// handleBeginSessionOK
} else {
// handleBeginSessionWithError:error
}
}];
And that's it.
Was that too fast? For more detailed instructions read the step by step install instructions here.
If you want to learn about the following topics, you find detailed information here. You also find the Intercom docset on cocoadocs.
- Session control
- Updating a user
- Working with attributes
- Company Data
- Custom Attributes
- Events
- Messaging
- Using Push notifications
- Intercom iOS SDK Architecture and Prerequisites
- How to configure Secure Mode in the SDK
By default the Intercom iOS SDK only logs errors. By calling the class method enableLogging
, you can increase the log level. It is recommended to use this only for debugging purposes, not the App Store build.