javascriptmeteorintercomintercom.js

Enable Intercom push notifications in a Meteor web app


We use Intercom in our Meteor app. We only call Intercom in Javascript like Intercom('boot') for instance (as described in their documentation for single page web apps).

This all works fine so far, except the push notifications. The documentation assumes Intercom is installed directly into a Cordova app.

Has anyone managed to get intercom push notifications to work on Android / iOS with a Meteor app?


Solution

  • first, you should know I haven't tested this myself, but I am familiar with both Meteor and Intercom. That said, here are my thoughts on a path to success:

    First, you would want to add this to your mobile-config.js file:

    App.setPreference('intercom-app-id', 'xxxxxxxxxx');
    App.setPreference('intercom-ios-api-key', 'ios_sdk-xxxxxxxx');
    App.setPreference('intercom-android-api-key', 'android_sdk-xxxxxxxxx');
    

    Then, you can use the Cordova functionality something like this:

        if (Meteor.isCordova) {
            // define values for userId and phoneNumber...
            intercom.registerIdentifiedUser({userId: userId,phone:phoneNumber});
        }
        ...
    

    I'm not entirely sure how you're trying to use push notifications, but let me know your thoughts on this or if this helps. Thanks!