Tag: firebase云消息传递

Firebase是否仍然支持Mac OS X – 2016年7月

我有一个使用Firebase实时数据库的iOS应用程序,我希望为Mac OS X创build这个应用程序。由于Firebase控制台只显示将Firebase添加到iOS,Android或Firebase的选项,Firebase是否仍支持最新更新中的Mac OS X网页应用程序 如果是的话,我在哪里可以find它? 谢谢

Firebase更新后,Xcode中架构x86_64的未定义符号

我更新了FirebaseUI到最新版本,并更新TwitterCore 3.0.0(是2.8.0),自从我在Xcode中得到这个编译器错误: Undefined symbols for architecture x86_64: "_TWTRIdentifierForAdvertising", referenced from: +[TWTRCardConfiguration deviceID] in TwitterKit(TWTRCardConfiguration.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 我目前恢复到以前版本的TwitterCore,即使它没有明确写入我的Podfile中。 我写了pod 'TwitterCore', '~>2.8.0'

使用Firebase提供的API密钥无效

我正在使用Firebase身份validation,允许用户使用Facebook注册。 我已经采取了从这里开始的所有步骤来实现注册,包括将GoogleService-Info.plist添加到我的项目中。 我得到的Facebook权限屏幕一切正常,但当应用程序点击 FIRAuth.auth()?.signInWithCredential(credential) { (user, error) in 返回此错误: 请求中提供了一个无效的API密钥。 任何人都可以帮助我吗? 谢谢 这是我使用Facebooklogin的function代码。 @IBAction func signUpWithFacebook() { let fbLogin = FBSDKLoginManager() fbLogin.logInWithReadPermissions(["email"], fromViewController:self, handler: { (result, error) -> Void in if ((error) != nil) { print("Process error") } else if (result.isCancelled) { print("Cancelled"); } else { print("Logged in"); let accessToken = FBSDKAccessToken.currentAccessToken().tokenString let credential = […]

Firebase – iOS Swift:使用从两个单独的子节点中检索的数据加载表格视图单元格

我正在使用Firebase构build应用程序,以在表格视图中显示问题列表。 每个表视图单元格包含问题的文本,发布它的用户的名称以及发布该用户的个人资料照片。 下面是我如何构build我的JSON树: "questions" "firebase_autoID_01" "name": "Jim" "text": "Why is the earth round?" "userID": "123456" "userInfo" "userID": "123456" "photoURL": "gs://default_photo" 我试图检索每个问题的name和text ,用相应的userID用户的photoURL ,然后将这3个元素放在每个表视图单元格。 所以我试图从questions子节点和独立的userInfo子节点检索数据,把这些数据放到同一个表视图单元格。 这里是我一直试图做的代码: 当用户第一次创build时,我将他们的photoURL设置为手动上传到Firebase存储的默认图像: … let placeholderPhotoRef = storageRef.child("Profile_avatar_placeholder_large.png") let placeholderPhotoRefString = "gs://babble-8b668.appspot.com/" + placeholderPhotoRef.fullPath //let placeholderPhotoRefURL = NSURL(string: placeholderPhotoRefString) let data = [Constants.UserInfoFields.photoUrl: placeholderPhotoRefString] self.createUserInfo(data) } func createUserInfo(data: [String: String]) { configureDatabase() […]

Firebase中的嵌套信息

我如何访问处于“更深层”快照级别的信息? 我是否总是需要启动另一个查询? 为了向您展示我的意思,我有一个结构的屏幕截图:DataStructure的屏幕截图 我正在加载我的查询中的所有post,我可以阅读作者信息等,但我怎么能得到选项内的信息? 我尝试了以下内容: ref.child("posts").child("details").observe(.childAdded, with: { (snapshot:FIRDataSnapshot) in if snapshot.value == nil { return } let post = Post() guard let snapshotValue = snapshot.value as? NSDictionary else { return } post.postID = snapshot.key post.title = snapshotValue["title"] as? String post.postDescription = snapshotValue["description"] as? String if (post.postDescription == ""){ post.postDescription = "No description has been […]

Firebase Swift childByAutoId()

根据Firebase文档 , childByAutoId应该在被调用时生成一个唯一的ID。 好的,但是我在这里使用它: let DeviceInfo = [ "ImageUrl":profileImageUrl!, "DeviceName":self.DeviceName.text!, "Description":self.Description.text!, "Category":self.itemSelected ] as [String : Any] self.ref.child("Devices").child(FIRAuth.auth()!.currentUser!.uid).observeSingleEvent(of: .value, with: {(snapShot) in if snapShot.exists(){ let numberOfDevicesAlreadyInTheDB = snapShot.childrenCount if numberOfDevicesAlreadyInTheDB < 3{ let newDevice = String("Device\(numberOfDevicesAlreadyInTheDB+1)") let userDeviceRef = self.ref.child("Devices").child(FIRAuth.auth()!.currentUser!.uid) userDeviceRef.observeSingleEvent(of: .value, with: {(userDevices) in if let userDeviceDict = userDevices.value as? NSMutableDictionary{ userDeviceDict.setObject(DeviceInfo,forKey: newDevice as! […]

Firebase Swift 3完成处理程序Bool

我试图编写一个函数的完成处理程序,检查用户是否是firebase中的一个团队的成员。 我有一个公共类customFunctions ,其中我创build了一个函数ifUserIsMember 。 我似乎有点卡在完成处理程序的想法,似乎无法弄清楚如何检查完成时的布尔值(如果这是有道理的)。 这是我的代码: import Foundation import GeoFire import FirebaseDatabase public class customFunctions { func ifUserIsMember(userid: String, completionHandler: @escaping (Bool) -> ()) { let ref = FIRDatabase.database().reference() ref.child("teammembers").observeSingleEvent(of: .value, with: { (snapshot) in if snapshot.hasChild(userid){ completionHandler(true) }else{ print("user is not a member of a team") completionHandler(false) } }) } } 这就是我所说的: @IBAction func […]

从匿名数据库中删除匿名用户

我正在使用Firebase数据库,并且与下一个情况有点混淆。 让我们想象我有待办事项的应用程序。 我使用标准的Firebase身份Auth系统在用户设备之间同步items 。 但在其他情况下,用户可以匿名工作而不需要同步。 步骤1: 用户启动应用程序第一次,并在AppDelegate我创build匿名用户: FIRAuth.auth()?.addStateDidChangeListener { auth, user in if let _user = user { if _user.isAnonymous { print("User logged in as anonymous. Saving uid to user defaults storage.") UserDefaults.standard.setValue(_user.uid, forKey: "uid") } else { print("User logged in with email: \(_user.email)") } } else { FIRAuth.auth()?.signInAnonymously() { (user, error) in if let […]

如何从Firebase逆转项目的顺序

如何从Firebase中撤消此列表的顺序? 我想要最后一个项目是第一个。 我试图使用queryOrdered ,但是没有什么区别。 我列出了一个从Firebase检索的数据结构示例: "-KhPRPQEOiVzPW7G2iQI" : { "amount" : "20", "coordinate" : { "lat" : 28.10388759332169, "long" : -81.46038228976457 }, "creationTime" : "2017-04-11 00:37:29 +0000", "creator" : "6MAK7nkzoBT6NzIxj7DW3564cf72", "description" : "A ride ", "distanceRadius" : 1609.34, "expireTime" : "2017-04-11 03:37:00 +0000", "paymentNonce" : "51df2b01-9e97-0fce-14d5-fc8fdf98603c", "provider" : "PSEFUZdAAxRH14oYnyzE7yMpcil1", "status" : "accepted" }, 码: func retrieveRquestFromFir(){ […]

将数组发布到Swift中的firebase数据库

题 我需要将数据发布到firebase数据库中,(就数组而言)只能接受typesNSArray 。 然而,应用程序需要添加到数组中 Json将被张贴的数据 Object: someObjectKey[ ArrayOfItems[ Item: someItemNumber Item: someItemNumber Item: someItemNumber ] TimeStamp: 102047355 SomeOtherTimeStamp: null SomeInt: 1111 someOtherInt: 2222 SomeBoolean: false ] } 目标 我怎样才能把上面的数据推送到数据库中? 尝试途径 – 将一个SwiftArray成一个NSArray – 将一个NSMutableArray成一个NSArray 码 public func postToFireBase(){ var Timestamp: String { return "\(NSDate().timeIntervalSince1970 * 1000)" } var someInt = 1111 var someOtherInt = 2222 […]