0
我正在使用谷歌登錄Xamarin iOS應用程序,但是在顯示的Safari瀏覽器提示中成功輸入用戶名和密碼後,它將屬性CurrentUser返回爲null。谷歌登錄返回當前用戶爲空
我的代碼:
Google.SignIn.SignIn.SharedInstance.Delegate = this;
Google.SignIn.SignIn.SharedInstance.UIDelegate = this;
Google.SignIn.SignIn.SharedInstance.SignInUser();
Google.SignIn.SignIn.SharedInstance.SignedIn += SharedInstance_SignedIn;
private void SharedInstance_SignedIn(object sender, SignInDelegateEventArgs e)
{
var signin = (Google.SignIn.SignIn)sender;
//Here if i debug signin variable, its property CurrentUser comes as null
}
我使用 Xamarin.IOS.Google.Signin:v4.0.1.1
我失去了一些設置,需要在谷歌API控制檯啓用?
好吧,我得到CurrentUser,如果我添加Google.SignIn.SignIn.SharedInstance.SignInUser()觸發SharedInstance_SignedIn事件。 但如果我不添加Google.SignIn.SignIn.SharedInstance.SignInUser()它不會觸發事件 –
@NathanN和你的問題? –
是否需要激發SharedInstance_SignedIn事件的Google.SignIn.SignIn.SharedInstance.SignInUser()?在我的情況下,只有當我添加上面的行時纔會觸發事件 –