Firebase的iPad的Safari;找不到变量:通知 [英] Firebase on iPad's Safari; Can't find variable: Notification

查看:140
本文介绍了Firebase的iPad的Safari;找不到变量:通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Firebase的云端通讯功能,但在iPad和iPhone上无法使用。这是我可以用它做的最简单的用法。我只是做了关于异地通知的所有教程,但是直接在Firebase的脚本中出现了这个错误:。

解决方案

您使用的firebase JavaScript库与iOS上的Safari不兼容。在iOS设备上运行的Safari浏览器与应用程序的桌面版本不同,并且没有相同的功能集。



在这种特定情况下,iOS Safari在尝试使用Web Notification API requestPermission()方法的firebase.js库中发出错误消息,以便允许Firebase向用户显示通知。 Notification API不存在。



您可以在这里看到对Notification API的支持: http://caniuse.com/#search=通知



您可能需要查看备用或禁用在不支持它的移动设备上查看您的Web应用程序时的Firebase库。如果它应该在iOS Safari上运行,那么你应该向Firebase提交一个bug,看看是否有可用的补丁或更新来解决firebase.js库中的问题。


I use Firebase's cloud messaging, but it won't work on iPad and iPhone. It's the simplest usage i can do with it. I just did all the tutorial about offsite notifications but i got this error directly in the Firebase's script.

解决方案

The firebase JavaScript library you're using is incompatible with Safari on iOS. The Safari browser that runs on iOS devices is not the same as the desktop build of the application and does not have the same feature set.

In this specific case, iOS Safari is throwing an error on your firebase.js library attempting to use the Web Notification APIs requestPermission() method in order to allow firebase to show notifications to the user. The Notification API doesn't exist though.

You can see the support for the Notification API here: http://caniuse.com/#search=Notification

You may have to look at an alternative or disable the firebase library when your web app is viewed on mobile devices which don't support it. If it's supposed to work on iOS Safari then you should file a bug with Firebase and see if there's a patch or update available which resolves the issue in the firebase.js library.

这篇关于Firebase的iPad的Safari;找不到变量:通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆