我使用Firebase的云消息传递,但它不适用于iPad和iPhone。这是我能用它做的最简单的用法。我刚刚完成了所有关于异地通知的教程,但我直接在Firebase的脚本中得到了这个错误. 最佳答案 iOS不支持通知APIhttps://caniuse.com/#search=Notification我创建了一个函数,让您知道用户的浏览器是否支持它。constisSupported=()=>'Notification'inwindow&&'serviceWorker'innavigator&&'PushManager'inwindo
我正在尝试为firebase创建一个云函数,它根据延迟值删除用户并在延迟数之后插入。exports.delayqueue=functions.database.ref('/queues/{queueid}/members/{memberid}').onWrite(event=>{varmembers=event.data.ref.parent;varuser=event.data;varqueueid=members.parent;varuserid=event.params.memberid;vardelayfor=user.child('delay').val();varname=
假设数据是这样的post:{authorId:'123AA',title:'firstPost',body:'yay'}author:{uid:'123AA',displayName:'Richard'email:'im@richard.com'}我想渲染一个带有作者姓名的帖子:{post.title}{post.body}{post.author.displayName}//problem获取的帖子项目仅包含作者的uid,但我需要作者的displayName。检索帖子时如何填充作者字段?这是我现在用来获取帖子的方法:constpostsRef=firebase.database().
我试图让.then()与.on()一起工作,但它只与.once()一起工作.我得到playersRef.on(...).thenisnotafunction,当用on()尝试它时所以我现在拥有的是:letnodesRef=Firebase.database().ref('players')letanswers={}playersRef.on('value',(playersSnapshot)=>{playersRef.once('value').then((playersSnapshot)=>{playersSnapshot.forEach((playerSnapshot)=>{let
所以我真的很接近解决这个问题了。基本上,我有登录工作,我有代码设置来监视onAuthStateChanged,但问题是当我刷新页面时,即使用户当前已登录,它仍然重定向到/login页面因为我已经设置了authguard,检查用户是否登录。我有一个身份验证服务设置,可以执行所有身份验证检查。在我的auth服务构造函数中,这是我设置onAuthStateChanged代码的地方:constructor(privateauth:AngularFireAuth,privaterouter:Router,privatedb:AngularFireDatabase,){firebase.auth(
我正在尝试初始化安全存储插件。如果失败,则意味着用户没有设置安全锁屏。使用github页面,我正在尝试重新创建提供的示例:varss;var_init=function(){ss=newcordova.plugins.SecureStorage(function(){console.log('OK');},function(){navigator.notification.alert('Pleaseenablethescreenlockonyourdevice.Thisappcannotoperatesecurelywithoutit.',function(){ss.secureDev
我编写了一个函数来接收http请求并发送电子邮件。但是,我想接收一个http请求并发送一个pub消息。问题是文档不清楚。我该怎么做?这是我的实际代码。exports.weeklyEmail=functions.https.onRequest((req,res)=>{constemail='****@gmail.com'console.log('Sendinge-mail')constmailOptions={to:email,from:'****@alunos.utfpr.edu.br',subject:'Teste',text:'Conteudodoemail'}mailTransp
我将以下CloudFunction部署到我的Firebase项目中:exports.createCredentials=functions.https.onCall((data,context)=>{if(!context.auth)thrownewfunctions.https.HttpsError('failed-auth','Youmustbeauthenticatedtocallthisfunction')const{email,password}=data;if(!(typeofemail==='string'))thrownewfunctions.https.HttpsEr
我们正在编写一个监控在线状态的应用程序。在多种情况下,我们需要用户打开多个浏览器窗口。我们遇到了一个问题,用户在辅助浏览器窗口中打开并运行firebasejs代码后,将关闭该辅助窗口。这会将它们在主窗口中设置为离线,因为onDisconnect事件会在辅助窗口中触发。这种情况有解决方法吗?这是可以使用特殊/.info/connected位置的地方吗? 最佳答案 .info/connected存在数据仅告诉给定客户端它们是否链接到Firebase服务器,因此在这种情况下它不会帮助您。您可以尝试以下方法之一:如果离线则重置变量如果您有多
我正在尝试使用orderByChild()在Firebase中按时间戳进行排序,但它不起作用。结果似乎是按键排序的,而Firebase似乎忽略了orderByChild()。从时间上可以看出,这些结果并不是按时间戳排序的。lorem-ipsum-dolor-si-17/6/2016alas8:51:33lorem-ipsum-dolor-si193-17/6/2016alas8:51:37lorem-ipsum-dolor-si297-17/6/2016alas8:51:43lorem-ipsum-dolor-si402-17/6/2016alas8:51:38这是我获取数据的方式:l