創建App-Google sign in my App
本App設想登入方法有Google、AppleID、FB等三種方法來登入,現在來使用以下編碼達成使用Google登入吧!
編碼:
[GIDSignIn.sharedInstance
signInWithConfiguration:signInConfig
presentingViewController:self
callback:^(GIDGoogleUser * _Nullable user,
NSError * _Nullable error) {
if (error) { return; }
if (user == nil) { return; }
// Your user is signed in!
}];
將按鈕連接到signInWithConfiguration:presentingViewController:callback: