【问题标题】:Web push notification FCM will work on iPhone and iPad devices?Web 推送通知 FCM 是否可以在 iPhone 和 iPad 设备上使用?
【发布时间】:2021-02-18 10:47:02
【问题描述】:

我有一个网站,我必须向所有设备和所有浏览器发送 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证书做吗?

【问题讨论】:

    标签: ios web push-notification firebase-cloud-messaging


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-27
      • 2021-09-13
      • 2023-03-22
      • 2020-11-16
      • 2021-01-07
      • 1970-01-01
      • 2018-03-21
      • 2021-01-07
      相关资源
      最近更新 更多