草庐IT

firebase-measurement-connector-im

全部标签

javascript - 来自 Google 身份验证提供程序的 Firebase photoURL 返回颜色反转的 jpg

当我通过Firebase对用户进行身份验证时(如下),生成的user包含一个颜色反转的photoURL。单击此jpgurl以查看颜色反转:https://lh3.googleusercontent.com/-JVpfmGGJuO8/AAAAAAAAAAI/AAAAAAAAAME/sMJVq9F8gec/photo.jpg然而,当我将该URL粘贴到StackOverflow的“图像”编辑器按钮时,它在下方显示了未反转的图像:signIn(){varprovider=newfirebase.auth.GoogleAuthProvider();provider.addScope('https

javascript - 如何使用 Firebase Cloud Functions 在 DataSnapshot 中查找特定值

我正在尝试制作一个云函数,它将在HTTP请求(通过计时器发送)上触发,这将删除所有具有特定值的child。数据库节点如下所示:activities4GI1QXUJG0MeQ8Bq19WOdCQFo9r1//uidactivity:"hammer"id:someIDnote:"somenote"timestamp:sometimeintervalsince19707IDUiufhiws8939hdfIUHiuhwdi5etc....我想查看所有的事件,如果事件值为“锤子”,我想移除这个child。这是我目前的情况exports.deleteHammerNotifications=func

javascript - Firebase 函数不记录 "console.log()"语句

我一直在为下面的函数而苦苦挣扎,它的console.log()语句没有出现在Firebase日志中。如果我删除所有以db.collection调用开头的内容,顶部的console.log()语句就会显示出来,但是一旦我添加了db.collection调用,没有console.log()语句出现在Firebase的日志中。我对JavaScript不是很熟悉(我通常使用Python进行后端编程),所以这可能是Promises工作方式的问题。我现在正在研究这个。知道发生了什么吗?exports.purchaseItem=functions.https.onCall((data,context

firebase - Sec-Fetch-Mode 而不是 Preflight

我创建了登录FE并完成了它。和往常一样,我的ajaxgoto是Axios。我的代码如下。constbaseUrl=http://localhost:5000/project/us-central1/apiAxios.post(`${baseUrl}/v1/user/login`,{...data},{headers:{Authorization:'Basicauth...'}},).then(r=>console.log(r).catch(e=>console.log(e));现在,当我尝试向我的本地firebase云函数发送请求时。我收到400错误请求。检查请求后,我想知道为什么它没

javascript - Firebase child_added 没有先加载所有数据

我有一个应用程序,我想在其中加载一些初始数据(使用Firebase.once('value')完成),然后在稍后的某个时候我想接收事件已添加到该Firebase引用的子节点的数量。为此,我想使用Firebase.on('child_added'),但根据定义(并在实践中看到),它首先加载该Firebase引用中的所有数据.有没有办法绕过这种行为,只监听child_added事件。此外,像转储初始数据集这样的变通方法并不是解决方案(想象一个包含超过一百万个数据点的数据集-我不想每个数据点都只是为了在添加一个数据点时监听!)。编辑:Firebase.on('child_added')可以与

javascript - 直接在 on() 回调中使用 off() Firebase?

假设我有一个一次性手术。喜欢删除。varq=ref.child('users').child(targetUserId).child('chat');q.on('child_added',function(obj){obj.ref().remove();//Thisworksright?q.off();});我可以在on()回调中直接执行off()吗?我不需要指定eventType对吗?没有别的要清理了吧?Fromthedocs:同样,如果没有指定事件类型或回调,则引用的所有回调都将被删除。 最佳答案 CanIexecuteoff(

javascript - 如何将函数外部的变量传递给 firebase 事件

下面是我在nodeJS服务器上运行的代码,我正在尝试sendanSMSmessage一旦'child_added'事件被触发//TwilioCredentialsvaraccountSid='';varauthToken='';vartwilio=require("twilio");varclient=newtwilio.RestClient(accountSid,authToken);//TWILIOFunctionclient.messages.create({to:"+12432056980",//Thisneedtobeobtainedfromfirebasefrom:"+14

javascript - 如何使用 Node.js、Angular.js 和 Firebase 实现无限滚动?

更新8:代码:varconfig={info};firebase.initializeApp(config);varfb=firebase.database().ref("posts/fun");varapp=angular.module('app',['firebase']);app.controller('ctrl',function($scope,$firebaseArray,$timeout){$scope.data=[];var_start=0;var_end=4;var_n=5;$scope.getDataset=function(){fb.orderByChild('id

javascript - 使用 firebase 的网络谷歌身份验证

uncaughtexception:Error:Thisoperationisnotsupportedintheenvironmentthisapplicationisrunningon."location.protocol"mustbehttp,httpsorchrome-extensionandwebstoragemustbeenabled.varconfig={apiKey:"*****",authDomain:"******",};firebase.initializeApp(config);varprovider=newfirebase.auth.GoogleAuthProv

javascript - 在 firebase 中 - 如何在服务器上生成 idToken 以进行测试?

我想测试一个创建用户的云函数。在正常情况下,我在浏览器中生成一个idToken并通过header将其发送到服务器:Authorization:BeareretcIdToken但是我想在没有浏览器的情况下测试这个功能。在我的摩卡测试中,我有:before(done=>{firebase=requirefirebase..--thisissupposetobelikethebrowserlib.admin=requireadmin..idToken=null;uid="AY8HrgYIeuQswolbLl53pjdJw8b2";admin.auth().createCustomToken(