ios - Web 推送通知 FCM 是否可以在 iPhone 和 iPad 设备上使用?
问题描述
我有一个网站,我必须向所有设备和所有浏览器发送 Web 推送通知。根据我的搜索,我得到了一些答案,即 Web 推送通知不适用于 Ipad 和 iPhone 设备。现在我正在使用 Firebase 云消息服务进行通知。这是我的代码。
firebase.initializeApp({
apiKey: "AIzaSy.....................KvPTQ",
authDomain: "dro.......firebaseapp.com",
databaseURL: "https://dsadasdasda-default-rtdb.firebaseio.com",
projectId: "xyz",
storageBucket: "xyz.appspot.com",
messagingSenderId: "18........55",
appId: "1:183....6955:web:0a3.......5e",
measurementId: "G-L....31"
});
// Retrieve an instance of Firebase Messaging so that it can handle background
// messages.
const messaging = firebase.messaging();
那么是否可以使用 APN 证书?
解决方案
无法向 iPhone 设备上的浏览器发送推送通知(使用 Firebase 云消息传递),因为它们不支持推送 API,https://caniuse.com/push-api。至于 Firebase 以外的其他服务,我很确定它也不会工作。我自己确实环顾四周,但不幸的是到目前为止还没有找到任何解决方案。
即使您使用 APN 证书,我认为您也必须采取让用户安装处理推送通知的本机应用程序的方法,这通常是您在决定开发 Web 应用程序时试图避免的。:)
推荐阅读
- python - NoReverseMatch - 不是注册的命名空间
- bash - 如何在 bash 中删除多个 zip 文件?
- javascript - JSON 访问数据 - 奇怪的行为
- android - 无法膨胀 Recyclerview
- javascript - 如何处理涉及 Casperjs 中模式弹出窗口的异步请求?
- java - Gradle 尝试在 IntelliJ 插件项目中使用 PsiMethod 构建类失败
- android - 浓缩咖啡:想要匹配 1 个意图。实际上匹配了 2 个意图
- java - 字节数组的最短字符串编码
- javascript - 角度和javascript中的上滑动画
- javascript - 将json转换为数组