草庐IT

updateChildValues

全部标签

ios - Swift 3 "updateChildValues"方法失败,返回 : Invalid key in object. 键必须为非空且不能包含 '.' '#' '$' '[' 或 ']' '

我正在尝试使用电子邮件作为值来更新Firebase数据库。但是Swift3“updateChildValues”方法失败并出现错误:对象中的无效键。键必须是非空的并且不能包含“.”'#''$''['或']''代码是:letkey=emailQueueRef.childByAutoId()ifuser.email!=nil{inviteUpdate["\(key)"]=user.email!}emailQueueRef.updateChildValues(inviteUpdate)可能由于电子邮件中的点而失败。另一方面,将其编码为Base64并不能解决问题。同时使用“setValue”方

ios - 使用 UpdateChildValue 从 Firebase 编辑

我想在文本字段内编辑后更新子值。目前我有这个Action:@IBActionfuncupdateAction(_sender:Any){guardletitemNameText=itemName.text,letitemDateText=itemDate.textelse{return}guarditemNameText.characters.count>0,itemDateText.characters.count>0else{print("Completeallfields")return}letuid=FIRAuth.auth()?.currentUser?.uidletkey=

ios - 如何检查 Firebase 权限是否被拒绝?

如何在我的swift代码中检查“permission_denied”?!以便我可以向用户显示适当的警报?self.ref=Database.database().reference(withPath:"PlayerBoxes")//handle=ref.child(pID).observe(.value,with:{snapshotin//DoSomething}){(error)inprint(error.localizedDescription)}//UpdateinfointoFirebase,donotoverwriteentirenoderef.child(self.pID)

ios - 使用 UpdateChildValues 从 Firebase 中删除

我正在尝试同时从Firebase数据库的多个位置删除数据。Firebasedocs状态:"ThesimplestwaytodeletedataistocallremoveValueonareferencetothelocationofthatdata.YoucanalsodeletebyspecifyingnilasthevalueforanotherwriteoperationsuchassetValueorupdateChildValues.YoucanusethistechniquewithupdateChildValuestodeletemultiplechildreninas

ios - 使用 UpdateChildValues 从 Firebase 中删除

我正在尝试同时从Firebase数据库的多个位置删除数据。Firebasedocs状态:"ThesimplestwaytodeletedataistocallremoveValueonareferencetothelocationofthatdata.YoucanalsodeletebyspecifyingnilasthevalueforanotherwriteoperationsuchassetValueorupdateChildValues.YoucanusethistechniquewithupdateChildValuestodeletemultiplechildreninas