Включение пользователей Facebook для создания сообщений - PullRequest
0 голосов
/ 10 ноября 2018

Я смог настроить свое приложение так, чтобы пользователь мог зарегистрироваться по электронной почте и паролю, и смог сделать сообщение, но когда я интегрировал логин на Facebook, я не смог сделать никаких сообщений (запись в Firebase) Я посмотрел в разрешения, которые могут быть необходимы для этих пользователей, но не смог ничего найти. Ниже приведен мой код для отправки сообщений в firebase

    @IBAction func handlePostButton(_ sender: Any) {

    guard let userProfile = UserService.currentUserProfile else { return }


    //Firebase code
    //Lets make a reference to the database
    let postref = Database.database().reference().child("posts").childByAutoId()    //This will assign this post a specific identifier that we can reference it by.
    //This is referencing the place where you write a post
    let postObject = [
        "author":[
            "uid": userProfile.uid,
            "photoURL": userProfile.photoURL.absoluteString,
            "username": userProfile.username
        ],
        "text": textView.text,
        "timestamp": [".sv": "timestamp"]           //This is actually getting the time from Firebase, this is a server value.
    ] as [String:Any]
    postref.setValue(postObject, withCompletionBlock: {Error, ref in
        if Error == nil {
            self.dismiss(animated: true, completion: nil)
        }else {

            self.creatAlert(title: "Error", message: "Error making a Post!")
        }
    })

}

не уверен, что еще я должен смириться.

...