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

标签 javascript meteor intercom intercom.js

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

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

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

最佳答案

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

首先,您需要将其添加到您的 mobile-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});
    }
    ...

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

关于javascript - 在 Meteor 网络应用程序中启用对讲推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50685725/

相关文章:

javascript - 当页面重新加载时正在监视的属性未更改时,Vue watch 不会运行

javascript - 如何检测窗口哈希的变化?

Javascript 对键上的对象数组进行排序

javascript - 如何在 Meteor 的同一集合字段中添加来自同一表单的两个输入?

ios - Apple Mach-O 链接器错误 - 体系结构 x86_64 : "_UISceneWillEnterForegroundNotification" and "___isPlatformVersionAtLeast" 的 undefined symbol

javascript - 我在输入类型文件中的 onChange 之后得到未命名状态 - ReactJS

meteor :大多数 "Meteoric"清除表单字段的方法

node.js - 在 Meteor 中正确启用 filepicker.io 的安全性

android - 升级Intercom SDK会导致一堆 “Error:(6) Error retrieving parent for item: No resource found that matches the given name”错误