首页 > 解决方案 > 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 证书?

标签: ioswebpush-notificationfirebase-cloud-messaging

解决方案


无法向 iPhone 设备上的浏览器发送推送通知(使用 Firebase 云消息传递),因为它们不支持推送 API,https://caniuse.com/push-api。至于 Firebase 以外的其他服务,我很确定它也不会工作。我自己确实环顾四周,但不幸的是到目前为止还没有找到任何解决方案。

即使您使用 APN 证书,我认为您也必须采取让用户安装处理推送通知的本机应用程序的方法,这通常是您在决定开发 Web 应用程序时试图避免的。:)


推荐阅读