Google Sign-Inをアプリに統合することで、Googleアカウントを使用してFirebaseで認証しようとしています。AppDelegateがSwift 3のプロトコル 'GIDSignInDelegate'に準拠していません
- スウィフト3
- Xcodeの8
- Firebase 3.11.1
を私はまだAppDelegate
// Sign-in flow has finished and was succcesful if error is nil:
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!){
if let error = error {
print(error.localizedDescription)
return
}
guard let authentication = user.authentication else { return }
let credential = FIRGoogleAuthProvider.credential(withIDToken: authentication.idToken,
accessToken: authentication.accessToken)
// Finished disconnecting user from the app succesfully if error is nil:
func sign(_ signIn: GIDSignIn!, didDisconnectWithUser user: GIDGoogleUser!,
withError error: Error!) {
// Perform any operations when the user disconnects from app here.
// ...
}
におけるGIDSignInDelegate
の2つのメソッドを実装している:使用
私はまだですコンパイルの問題に直面している:
AppDelegate does not conform to protocol 'GIDSignInDelegate'
方法は、サインインが署名していないと呼ばれているドキュメントによります。 https://developers.google.com/identity/sign-in/ios/api/protocol_g_i_d_sign_in_delegate-p#pub-methodsあなたはGIDSignInDelegateのヘッダーファイルと同じですか? – Gruntcakes
@Grunt私はfunc sign()とfunc signIn()を試しました。それは働かなかった。 https://firebase.google.com/docs/auth/ios/google-signin –
問題のナビゲータ(⌘4)に移動し、エラーの横にある三角形の三角をクリックすると、どの方法が欠落しているかがわかります。 – vadian