Skip to content
React Native wrapper for
Java Objective-C JavaScript Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
android fix: add ability to override existing module to fix issues (#330) Apr 15, 2020
iOS Remove user information from logs (#318) Nov 7, 2019
lib Add error handling and refactor native modules to use Promises (#265) Feb 19, 2019
.DS_Store Upgrade to intercom v6 (#339) Apr 15, 2020
.gitignore Upgrade to intercom v6 (#339) Apr 15, 2020
LICENSE Initial commit Jul 9, 2015 Update (#333) Apr 15, 2020
index.d.ts Expand metadata types for events to what Intercom supports (#328) Jun 1, 2020
package.json 16.0.0 May 19, 2020
react-native-intercom.podspec Update Intercom to v6.1.0 (#366) May 19, 2020


React Native wrapper for Based off of intercom-cordova

Installation Guide

  1. Install Intercom for iOS via whichever method you prefer.

    More recently others have had more success Installing Intercom Manually.

    In the past, installing via CocoaPods was recommended.

  2. Install react-native-intercom:

    yarn add react-native-intercom  # or npm install react-native-intercom
  3. Link native dependencies

    react-native link react-native-intercom
  4. Manually Link the library in Xcode (Linking librarys on iOS)

    1. Open Xcode -> Right click "[Your Project Name]/Libraries" folder and select "Add File to [Your Project Name]" -> Select RNIntercom.xcodeproj located in node_modules/react-native-intercom/iOS.
    2. Open "General Settings" -> "Build Phases" -> "Link Binary with Libraries" and add libRNIntercom.a
  5. Config for iOS (intercom-ios)

    1. Add #import "Intercom/intercom.h" with the other imports at the top of ios/YOUR_PROJECT/AppDelegate.m.

    2. Initialize Intercom in ios/YOUR_PROJECT/AppDelegate.m with your Intercom iOS API Key and your Intercom App ID:

      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
          // Intercom
          [Intercom setApiKey:@"YOUR_IOS_API_KEY_HERE" forAppId:@"YOUR_APP_ID_HERE"];
    3. Optional, Intercom's documentation suggests adding the following call in order to receive push notifications for new messages:

      - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
          // Intercom
          [Intercom setDeviceToken:deviceToken];
    4. Optional, allow access to photos on iOS. Open Info.plist in Xcode and add a new key "Privacy - Photo Library Usage Description". Or alternately, open ios/YOUR_PROJECT/Info.plist and add:

        ...other configuration here...
        <string>Send photos to help resolve app issues</string>
        ...other configuration here...
  6. Config for Android (intercom-android)

    1. In android/app/src/main/java/com/YOUR_APP/app/, add the following code in the respective sections of the file using your Intercom Android API Key and Intercom App ID:

      // ...other configuration here...
      import com.robinpowered.react.Intercom.IntercomPackage;
      public class MainApplication extends Application {
        public void onCreate() {
          Intercom.initialize(this, "YOUR_ANDROID_API_KEY_HERE", "YOUR_APP_ID_HERE");
          // ...other configuration here...
        public List<ReactPackage> getPackages() {
          return Arrays.<ReactPackage>asList(
            // ...other configuration here...
            new IntercomPackage()
            // ...other configuration here...
    2. In android/build.gradle add maven { url "" } (h/t):

      allprojects {
        repositories {
          //...other configuration here...
          maven { url "" }
    3. Decide which type of push messaging you want to install, and add choosen method to android/app/build.gradle.

      1. If you'd rather not have push notifications in your app, you can use this dependency:

        dependencies {
            implementation ''
      2. If "Firebase Cloud Messaging(FCM)", then:

        dependencies {
          //...other configuration here...
          compile ''

        If you're already using FCM in your application you'll need to extend FirebaseMessagingService to handle Intercom's push notifications (refer to Using Intercom with other FCM setups)

        Here's an example if you're using react-native-firebase as your existing FCM setup:

        I. Add a new file if you don't have one (android/app/src/main/java/com/YOUR_APP/

        package com.YOUR_APP;
        import io.invertase.firebase.messaging.*;
        import android.content.Intent;
        import android.content.Context;
        import io.invertase.firebase.messaging.RNFirebaseMessagingService;
        import android.util.Log;
        import java.util.Map;
        public class MainMessagingService extends RNFirebaseMessagingService {
            private static final String TAG = "MainMessagingService";
            private final IntercomPushClient intercomPushClient = new IntercomPushClient();
            public void onMessageReceived(RemoteMessage remoteMessage) {
                Map message = remoteMessage.getData();
                if (intercomPushClient.isIntercomPush(message)) {
                    Log.d(TAG, "Intercom message received");
                    intercomPushClient.handlePush(getApplication(), message);
                } else {

        II. Then add the following code to android/app/src/main/AndroidManifest.xml:

        <?xml version="1.0" encoding="utf-8"?>
        <manifest package="com.YOUR_APP"
          ...other configuration here...
            ...other configuration here...
            <!-- ...other configuration here... -->
            <!-- ...ADD THE SERVICE BELOW... -->
                  <action android:name="" />
  7. Import Intercom and use methods

    import Intercom from 'react-native-intercom';
    // or…
    // var Intercom = require('react-native-intercom');
    Intercom.registerIdentifiedUser({ userId: 'Bob' });
    Intercom.logEvent('viewed_screen', { extra: 'metadata' });
    // of your file...

    Note that calling Intercom.registerIdentifiedUser({ userId: 'Bob' }) (or Intercom.registerUnidentifiedUser()) is required before using methods which require that Intercom know the current user… such as Intercom.displayMessageComposer(), etc.


Import or Require the module

import Intercom from 'react-native-intercom';


var Intercom = require('react-native-intercom');

Log an event

Intercom.logEvent('viewed_screen', { extra: 'metadata' });

Register a Logged In user

Intercom.registerIdentifiedUser({ userId: 'bob' });

Register Unidentified user


Register a Logged In user and post extra metadata

Intercom.registerIdentifiedUser({ userId: 'bob' })
    // Pre-defined user attributes
    email: '',
    user_id: 'user_id',
    name: 'your name',
    phone: '010-1234-5678',
    language_override: 'language_override',
    signed_up_at: 1004,
    unsubscribed_from_emails: true,
    companies: [{
        company_id: 'your company id',
        name: 'your company name'
    custom_attributes: {
        my_custom_attribute: 123

Set User Hash for Identity Validation (optional)


Sign Out


Show Message Composer


Show Message Composer with an Initial Message

Intercom.displayMessageComposerWithInitialMessage('Initial Message');

Display Latest Conversation


Display Conversations List


Display Help Center


Set Bottom Padding


Display Help Center


Note that before calling Intercom.displayHelpCenter() it is required to enable Help Center in your Intercom settings.

Listen for Unread Conversation Notifications

componentDidMount() {
  Intercom.addEventListener(Intercom.Notifications.UNREAD_COUNT, this._onUnreadChange)

componentWillUnmount() {
  Intercom.removeEventListener(Intercom.Notifications.UNREAD_COUNT, this._onUnreadChange);

_onUnreadChange = ({ count }) => {

Other Notifications

    // The window was hidden

    // The window was shown

Send FCM token directly to Intercom for push notifications (Android only)

  .then((token) => {
    console.log('Device FCM Token: ', token);
You can’t perform that action at this time.