问题
I follow guide enter link description here
I have a issue when I done login my google account it show toast
And browser not auto close to back my.
Thanks!
回答1:
In you CustomUrlSchemeInterceptorActivity page replace inside OnCreate.
base.OnCreate(savedInstanceState);
global::Android.Net.Uri uri_android = Intent.Data;
Uri uri_netfx = new Uri(uri_android.ToString());
// load redirect_url Page
AuthenticationState.Authenticator.OnPageLoading(uri_netfx);
var intent = new Intent(this, typeof(MainActivity));
intent.SetFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);
StartActivity(intent);
this.Finish();
return;
回答2:
This is the warning message shown in the toast.
We can make it null by adding a piece of code in MainActivity just after initializing Xamarin.Auth.
CustomTabsConfiguration.CustomTabsClosingMessage = null;
And for closing the CustomTab login screen and navigating back to your app, set the LaunchMode of your Custom URL activity to SingleTask.
LaunchMode = LaunchMode.SingleTask
Hope this will help.
回答3:
Worked for me as well in avoiding the toast:
global::Xamarin.Auth.CustomTabsConfiguration.CustomTabsClosingMessage = null
来源:https://stackoverflow.com/questions/47938171/xamarin-auth-google-not-auto-close-when-done-login