Skip to content

Expo plugin for adding @intercom/react-native-intercom using expo config plugins

Notifications You must be signed in to change notification settings

crloz/config-plugin-react-native-intercom

 
 

Repository files navigation

Expo Config Plugin @intercom/intercom-react-native

An unofficial Expo config plugin for easily setting up React Native Intercom with expo dev clients

Installation

Prerequisites

Versions > 1.3

  • App project using Expo SDK 45.
  • Installed expo-cli@4.4.4 or later.
  • Installed @intercom/intercom-react-native@3.0.3 or later

Versions < 1.3

  • App project using Expo SDK 44.
  • Installed expo-cli@4.4.4 or later.
  • Installed @intercom/intercom-react-native

With expo install

expo install config-plugin-react-native-intercom

Without expo install

# using yarn
yarn add config-plugin-react-native-intercom

# using npm
npm install config-plugin-react-native-intercom

Open your app.json and update your plugins section (expo install would do it for you):

{
  "plugins": ["config-plugin-react-native-intercom"]
}

Configuration

The plugin needs your intercom api key so that it can communicate with the intercom application.

{
  "plugins": [
    [
      "config-plugin-react-native-intercom",
      {
        "iosApiKey": "<your-api-key>",
        "androidApiKey": "<your-api-key>",
        "appId": "<your-app-id>"
      }
    ]
  ]
}

Other configuration options

Add a custom photo usage description
{
  "plugins": [
    [
      "config-plugin-react-native-intercom",
      {
        //...
        "iosPhotoUsageDescription": "Upload to support center"
      }
    ]
  ]
}
Add EU Region support

On iOS Add to app.json

{
  "ios": {
    "infoPlist:":{
        "IntercomRegion": "EU"
      }
  }
}

On Android

{
  "plugins": [
    [
      "config-plugin-react-native-intercom",
      {
        //...
        "intercomEURegion": "true"
      }
    ]
  ]
}

Android push notifications

If you want push notifications to fire when new messages are sent in a conversation, it is necesssary to create a push notification channel for these. Push notifications for new conversations require no additoonal setup.

useEffect(() => {
  if (Platform.OS === 'android') {
    Notifications.setNotificationChannelAsync('intercom_chat_replies_channel', {
      name: 'Intercom Replies Channel',
      description: 'Channel for intercom replies',
      importance: Notifications.AndroidImportance.MAX,
    })
  }
}, [])

Building and running

You can either:

  • use expo prebuild or expo run:android/expo run:ios to update your native projects,
  • use EAS Build to build your development client.

Contributing

Contributions are very welcome! The package uses expo-module-scripts for most tasks. You can find detailed information at this link.

Please make sure to run yarn build/yarn rebuild to update the build directory before pushing. The CI will fail otherwise.

Credits

License

MIT

About

Expo plugin for adding @intercom/react-native-intercom using expo config plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 48.5%
  • TypeScript 47.1%
  • Shell 4.4%