jjzjj

FireBase

全部标签

javascript - 使用 Redux-Saga 的 Firebase 身份验证不起作用

我正在尝试使用firebase身份验证创建一个新用户。我正在使用redux-saga进行上述调用。下面是我的saga.js:import{takeLatest,put}from'redux-saga/effects';import{SIGN_UP,AUTHENTICATION_FAILED,SIGN_UP_SUCCESS}from'../actions/index';importfirebasefrom'firebase';function*signUp(action){console.log("abouttocallauthentication");//Thisbeingprinte

javascript - Firebase Web Auth 在移动设备上不起作用?

我打算为我的网络应用程序使用Firebase的提供商身份验证,但它似乎不适用于移动设备。该网站在这里:https://cypher.city然后当你点击这个按钮时:将出现一个弹出窗口。当你点击这个按钮时:然后它应该进入谷歌提供商身份验证流程。我的代码如下所示:varprovider=newfirebase.auth.GoogleAuthProvider();firebase.auth().signInWithRedirect(provider).then((result)=>{//console.log('@$signinwihtgoogleworked!'+e+',useris:'+

javascript - 如何使函数与 Firestore 一起工作?

函数/index.js:constfunctions=require('firebase-functions')constadmin=require('firebase-admin')admin.initializeApp(functions.config().firebase)constdb=admin.database().ref()exports.app=functions.https.onRequest((req,res)=>{//dowhateverhere...db.child('something').once('value').then(snap=>console.lo

javascript - phonegap + ionic 使用 Content-Security-Policy 加载 maps.googleapis.com,如何?

我尝试了很多加载谷歌地图和firebaseio的方法,但都没有成功:这就是我现在拥有的:我得到:Refusedtoloadthescript'https://maps.googleapis.com/maps/api/js?libraries=places'becauseitviolatesthefollowingContentSecurityPolicydirective:"script-src'self'https://maps.googleapis.com/*'unsafe-inline''unsafe-eval'".Refusedtoloadthescript'https://t

javascript - 将 base64 编码的图像保存到 Firebase 存储

使用firebase3.0.x,是否可以将base64编码的图像保存到新的Firebase存储服务?我在上传图像之前使用Canvas在浏览器中调整图像大小,并将它们输出为base64jpeg。我知道Storageapi可以接受Blob,但我当前的项目需要IE9支持。 最佳答案 无需将BASE64转blob,只需使用putString函数即可。firebase.storage().ref('/your/path/here').child('file_name').putString(your_base64_image,‘base64’

javascript - 如何在 Cloud Functions for Firebase 中访问多个实时数据库实例

我在一个Firebase项目中使用多个数据库。主(默认)数据库的云函数工作得很好,但是,我不能让它们为辅助数据库工作。例如,我想在具有管理员权限的节点上发出读取请求://thisworksadmin.database().ref(nodePath).once('value')...这在主数据库中有效,但是,如果我想在另一个数据库上执行命令,它就不起作用了://thisdoesn'tworkadmin.database(secondaryDatabaseUrl).ref(nodePath).once('value')...虽然部署了功能,但在尝试执行云功能时,控制台出现错误。这是带有ht

javascript - 如何从 Firebase 获取服务器时间

我在使用angularjs和firebase时使用$scope.createdDate=newDate();它使用客户端上的时间,但我想使用Firebase服务器的当前时间,因为客户端时间可能会有所不同。我怎样才能有Angular地解决这个问题? 最佳答案 当你打印firebase.database.ServerValue.TIMESTAMP时,它会给你这个对象{.sv:"timestamp"}要在客户端上获取firebase服务器的时间戳,您首先需要将值写入到服务器,然后读取该值。firebase.database().ref('

javascript - 在 Firebase 查询中组合 orderByChild 和 equalTo

给定以下数据结构:{"comments":{"-JcBbk64Gpm1SKoFHv8b":{"content":"blah","createdAt":1417550954985,"link":"http%3A%2F%2Flocalhost%3A3000%2F","recommendedCount":0,"replies":{"-JcBbk8gF_nQ_vjwag61":true},"replyCount":1},"-JcBbk8gF_nQ_vjwag61":{"content":"blahblah","createdAt":1417550955151,"link":"http%3A%2

javascript - 如何在注销时注销 FCM 设备 token 和服务 worker 以及如何重新初始化 Firebase 应用程序?

我正在尝试实现Firebase云消息传递(FCM),以便将通知推送到我的Web应用程序(AngularJS)中。为此,我在根应用程序文件夹中创建了一个firebase-messaging-sw.js。//firebase-messaging-sw.js'usestrict';console.log('Startingserviceworker');if('function'===typeofimportScripts){importScripts('https://www.gstatic.com/firebasejs/3.5.0/firebase-app.js');importScri

javascript - 如何使用 firestore 执行动态 where 查询并添加索引

在我的网站上,我正在进行类似测试的调查,每个测试都有attendies子集合,看起来像这样当有人完成测试时,我也会将他们的uid添加到completed字段,就像我在框中绘制的那样。现在我想根据status==completed查询tests。这是我尝试过的this.completedModulesRef$=this.afs.collection('tests',ref=>ref.orderBy('moduleNum','desc').where('completed.'+auth.uid+'.status','==','completed'));this.completedModul