我正在尝试使用firebase身份验证添加Facebook登录信息。成功获取访问令牌后,我的应用程序崩溃了
SocialMediaIntegration.sharedInstance().performLogin(viewController: self) { (granterdPermission, declinedPermission, accessToken) in
self.showHud()
let credential = FacebookAuthProvider.credential(withAccessToken:accessToken)
Auth.auth().signIn(with: credential, completion: { (user, error) in
self.dismissHud()
if !FireBaseAuthHandler.sharedInstance().checkIfErrorExists(error:error){
self.showHud()
SocialMediaIntegration.sharedInstance().getInformationFromAccessToken(token: accessToken, completionHandler: { (data) in
self.dismissHud()
guard let uid = user?.uid else{ return }
self.updateUserAtFirebaseWithUId(uid: uid)
})
}
})
}
我成功获得了令牌,但Firebase本身的signIn(带:凭证)功能崩溃了。我没有接到进一步的电话。
func performLogin(viewController:UIViewController,completionHandler: @escaping CompletionHandler){
let loginManager = FBSDKLoginManager()
loginManager.logIn(withReadPermissions: ["public_profile", "email"], from: viewController) { (loginResult, error) in
if let err = error{
print(error.debugDescription)
}else{
if (loginResult?.isCancelled)! == true{
debugPrint("User cancelled login.")
}else{
debugPrint("accessToken:\(String(describing: loginResult?.token.tokenString))")
completionHandler((loginResult?.grantedPermissions)!,(loginResult?.declinedPermissions)!,(loginResult?.token.tokenString)!)
}
}
}
}
崩溃报告:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x600000228a20'
*** First throw call stack:
(
0 CoreFoundation 0x0000000108e031ab __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000107902f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000108e83a34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000108d860a8 ___forwarding___ + 1432
4 CoreFoundation 0x0000000108d85a88 _CF_forwarding_prep_0 + 120
5 FocusGame IOS 0x0000000104c5aaf1 -[FIRVerifyAssertionRequest unencodedHTTPRequestBodyWithError:] + 423
6 FocusGame IOS 0x0000000104c54fe3 -[FIRAuthBackendRPCImplementation postWithRequest:response:callback:] + 132
7 FocusGame IOS 0x0000000104c53f7f -[FIRAuthBackendRPCImplementation verifyAssertion:callback:] + 193
8 FocusGame IOS 0x0000000104c52e7e +[FIRAuthBackend verifyAssertion:callback:] + 95
9 FocusGame IOS 0x0000000104c3ad6b -[FIRAuth internalSignInAndRetrieveDataWithCredential:isReauthentication:callback:] + 760
10 FocusGame IOS 0x0000000104c3a99c -[FIRAuth internalSignInWithCredential:callback:] + 135
11 FocusGame IOS 0x0000000104c3a6e3 __43-[FIRAuth signInWithCredential:completion:]_block_invoke + 70
12 libdispatch.dylib 0x000000010c9f23f7 _dispatch_call_block_and_release + 12
13 libdispatch.dylib 0x000000010c9f343c _dispatch_client_callout + 8
14 libdispatch.dylib 0x000000010c9fb95b _dispatch_queue_serial_drain + 1162
15 libdispatch.dylib 0x000000010c9fc2df _dispatch_queue_invoke + 336
16 libdispatch.dylib 0x000000010c9f807d _dispatch_queue_override_invoke + 733
17 libdispatch.dylib 0x000000010c9ff1f9 _dispatch_root_queue_drain + 772
18 libdispatch.dylib 0x000000010c9fee97 _dispatch_worker_thread3 + 132
19 libsystem_pthread.dylib 0x000000010ceb75a2 _pthread_wqthread + 1299
20 libsystem_pthread.dylib 0x000000010ceb707d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Pods详细信息如下: