在 Meteor 网络应用程序中启用对讲推送通知

Enable Intercom push notifications in a Meteor web app

我们在 Meteor 应用程序中使用对讲机。例如,我们只在 Javascript 中调用 Intercom,例如 Intercom('boot')(如 single page web apps 的文档中所述)。

到目前为止一切正常,除了推送通知。 documentation 假定 Intercom 直接安装到 Cordova 应用程序中。

有没有人设法通过 Meteor 应用在​​ Android / iOS 上获得对讲推送通知?

首先,你应该知道我自己没有测试过这个,但我对 Meteor 和 Intercom 都很熟悉。也就是说,这是我对成功之路的看法:

首先,您需要将其添加到您的移动 config.js 文件中:

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

然后,您可以像这样使用 Cordova 功能:

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

我不完全确定您是如何尝试使用推送通知的,但请让我知道您对此的想法或者这是否有帮助。谢谢!