FacebookϩάΠϯ
[email protected]
[email protected]
func loginButton(loginButton: FBSDKLoginButton!,
didCompleteWithResult result: FBSDKLoginManagerLoginResult!,
error: NSError!) {
if let _ = error {
return
}
if result.isCancelled {
return
}
User.authenticate(with: Credential.facebook(token: result.token.tokenString),
server: URL(string: "http://128.199.141.202:9080")!, onCompletion: { user, error in
guard let user = user else {
fatalError(String(describing: error))
}
let configuration = Realm.Configuration(
syncConfiguration: (user, URL(string: "realm://128.199.141.202:9080/~/realmtasks")!)
)
self.realm = try! Realm(configuration: configuration)
})
}