The Intercom iOS library supports iOS 7.x and upwards.
Installing Intercom
There are two ways to install Intercom on your iOS app:
Using cocoapods
Manual Install
Download Intercom for iOS and use Finder to drag Intercom.framework and Intercom.bundle into your Xcode project, ticking the "Copy items if needed" checkbox.
If you get errors after installation, check out our Troubleshooting section below.
How to use Intercom in your app
Broadly speaking, there are three types of apps that Intercom will work in.
Apps that have only registered users, like Facebook, Instagram or Slack. Your users have to log in straight away in order to use your app.
Apps that never log users in, like Threes Game or Angry Birds or the iOS Notes app. Your users never have to log in to use your app.
Apps that support both logged in and logged out users, like Google Maps or Youtube.
Initialize Intercom
No matter what category of app you have, you'll need your Intercom app id along with the iOS API key. To find these, just select the 'Intercom for iOS' option in your app settings.
Once you've got your keys, initialize Intercom by calling the following in your application delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize Intercom
[Intercom setApiKey:@"" forAppId:@""];
}
My app only has logged in users
Note: If you want your users to continue to receive messages after they have logged out, do not call [Intercom reset]
until just before logging another user in.
My apps users never log in
My app has both logged in and logged out users
Tips on getting the best out of your installation
Do not use an email address as a userId as this field is unique and cannot be changed or updated later. If you only have an email address, you can just register a user with that. More details are available here.
If you register users with an email address then email must be a unique field in your app. Otherwise we won't know which user to update and the mobile integration won't work.
Intercom listens for when your app starts and stops, so all you need to do is register a type of user like the examples above and we'll do the rest.
Troubleshooting tips
If the iOS keyboard does not respond properly to rotation events on iPhone 6 and iPhone 6 Plus: there is a known issue in iOS 8.x for apps that scale their UIs rather than natively supporting those new screen sizes. If the app does support landscape and portrait orientations, but the view controller that is shown when the Intercom Messenger is opened does not allow rotation (by implementing the supportedInterfaceOrientations method), sometimes the keyboard positioning breaks on rotation. This can be fixed by supporting the iPhone 6 and 6 Plus screen sizes.
Important note: There's no default Messenger launcher in current SDKs. To open the Messenger window, you will need to specify a button in your app and then call a method. However, regardless of the default launcher, if an in-app message is sent to a user, it will pop our standard chat head and tapping it will open the Messenger.
Using Cordova or PhoneGap to install Intercom
You can use our Cordova plugin to install Intercom on your iOS and Android apps. This enables you to have the benefits of our fully native libraries within a hybrid app.
The plugin is available on Github and on the npm.
What next?
Once you've got Intercom installed it's time to configure it for your product. You also find the Intercom docset in the github repository.