我正在尝试使用新的Firebase平台进行Facebook登录.
这是facebook登录的代码
let facebookLogin = FBSDKLoginManager()
facebookLogin.logInWithReadPermissions(["email"], fromViewController: self) { (result, error) -> Void in
if error != nil {
print("error is \(error)")
} else {
let accessToken = FBSDKAccessToken.currentAccessToken().tokenString
let credential = FIRFacebookAuthProvider.credentialWithAccessToken(accessToken)
AUTH?.signInWithCredential(credential, completion: { (user, error) -> Void in
if error != nil {
print("error is \(error)")
} else {
print(user)
NSUserDefaults.standardUserDefaults().setValue(user?.uid, forKey: KEY_UID)
self.performSegueWithIdentifier(SEGUE_LOGGEDIN, sender: nil)
}
})
}
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误代码
可选(错误域= FIRAuthErrorDomain代码= 17999"发生内部错误,打印并检查错误详细信息以获取更多信息."UserInfo = {error_name = ERROR_INTERNAL_ERROR,NSUnderlyingError = 0x79f082b0 {Error Domain = FIRAuthInternalErrorDomain Code = 3"(null)" …
facebook-authentication firebase firebase-authentication swift2
我正在尝试在我的应用中使用Realm。我正在保存数据,一切都很好,但是当我最终想要读取数据并将其发送到Firebase时,我遇到了错误。
@IBAction func registerButtonTapped(sender: BouncingButton) {
if !monday.isEmpty() && !tuesday.isEmpty() && !wednesday.isEmpty() && !thursday.isEmpty() && !friday.isEmpty() && !saturday.isEmpty() && !sunday.isEmpty() {
Constants.ActivityIndicator.startActivity()
self.days.setObject(["open":monday.open,"close":monday.close], forKey: "Monday")
self.days.setObject(["open":tuesday.open,"close":tuesday.close], forKey: "Tuesday")
self.days.setObject(["open":wednesday.open,"close":wednesday.close], forKey: "Wednesday")
self.days.setObject(["open":thursday.open,"close":thursday.close], forKey: "Thursday")
self.days.setObject(["open":friday.open,"close":friday.close], forKey: "Friday")
self.days.setObject(["open":saturday.open,"close":saturday.close], forKey: "Saturday")
self.days.setObject(["open":sunday.open,"close":sunday.close], forKey: "Sunday")
let email = Constants.clubRegisterForm.email
let password = Constants.clubRegisterForm.password
let credential = FIREmailPasswordAuthProvider.credentialWithEmail(email, password: password)
Constants.FirebaseAPI.Auth?.createUserWithEmail(email, password: password, completion: { (user, error) in
if error != nil {
Constants.ActivityIndicator.stopActivity()
Constants.Alerts.checkErrors(error!)
} else {
let changeRequest = user?.profileChangeRequest()
changeRequest?.photoURL …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我需要用户输入他的家庭地址,但我不能得到任何方式显示的地址只在用户区域,并且是完整的地址,如225e 57th st, NY, New York.
我想在tableview上为用户提供所有列出的选项,并在用户输入他的地址时对其进行过滤.