我實現登入Google+ iOS中,我用這個代碼,它工作正常trySilentAuthentication沒有Google+按鈕
signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
//signIn.shouldFetchGoogleUserEmail = YES;
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[signIn authenticate];
我想用[簽到trySilentAuthentication]方法不留起來,每次用戶登錄在但是它並沒有使用谷歌+按鈕GPPSignInButton
所以工作時,有什麼不好使用此代碼,而不是上面
signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
//signIn.shouldFetchGoogleUserEmail = YES;
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[signIn trySilentAuthentication];
的一個是它POSS能使用didSelectRowAtIndexPath使用trySilentAuthentication嗎? 在此先感謝
通過拆分代碼,這將使用戶始終登錄,而我有其他選項,我希望他選擇。我編輯我的代碼與我嘗試的,這兩個代碼在didSelectRow嘗試.. – Twinkle
爲什麼你想要讓用戶選擇,如果他們已經登錄?如果您希望它們能夠連接多個帳戶,或者如果您希望它們能夠切換帳戶,您仍然可以向他們顯示選項列表,您應該使用signOut方法,這也會阻止trySilentAuthentication觸發。 –
已更新的答案,以澄清trySilentAuthentication的目標是什麼。 –