我在Xamarin.Android上编写移动应用程序,它使用Facebook授权。用户授权后,Facebook身份验证屏幕不会立即消失。它停留了一段时间,然后回到开始屏幕。但是我需要将用户移动到具有主要功能的屏幕。
// this is a method in MainActivity which shows user Facebook auth screen,
// and then calls callback function from shared assembly where is all GUI
private async Task Authenticate(Action<MobileServiceUser> actionOnComplete)
{
try
{
var user = await _client.LoginAsync(this,
MobileServiceAuthenticationProvider.Facebook).ConfigureAwait(false);
actionOnComplete(user);
}
catch {
}
}
// Here is a implementation of callback function 'acitionOnComplete'
// in shared Xamarin assembly
void OnFacebookLoggedIn(MobileServiceUser user)
{
// This code doesn't switches to PhoneEnterScreen at all.
// Possibly because Facebook screen is still there
Navigation.PushAsync (new PhoneEnterScreen ());
}
答案 0 :(得分:0)
修改以使其更像是一个答案!
您应该正在侦听Facebook Access令牌的更改,并使用它来提示您的UI推送主屏幕。我怀疑你的实现在某个地方被挂起了。
您应该执行以下操作: