Xamarin.Auth Google Presenter not closing

IU am using Xamarin.Auth in a Xamarin.Forms app. Everything works perfectly except that the presenter does not close. It simply moves to the background.

I have a LoginVIewModel (MVVM) in my shared project whcih creates the OAuth2Authenticator and the Intercept Activity in the Android app.

In my In GoogleAuthInterceptor Activity in the create I have

protected override void OnCreate(Bundle savedInstanceState)

        // Convert Android.Net.Url to Uri
        var uri = new Uri(Intent.Data.ToString());

        // Send the URI to the Authenticator for continuation


I show the presenter as follows:

var loginUI = App.OAuth2Authenticator.GetUI(Forms.Context);

I have also tried using:

var oAuthLoginPresenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();

The presenter shows fine using wither way, user approves and I am redirected back to my App and the completed event on the OAuth2Authenticator is called where I can use the account to get the user information as required

private async void OAuth2Authenticator_Completed(object sender, AuthenticatorCompletedEventArgs e)

            // dismiss presenter???

                App.Account = e.Account;

                var oAuthUser = await GetUserDetails();     

                // Add account to store
                AccountStore.Create().Save(App.Account, App.APP_NAME_KEY);

                // Set the App User for this session
                App.User = oAuthUser ;

        catch(Exception ex)

At this stage if I click the application button on my phone I have see the presenter is still in the background. How can I shut it down in the view model once the completed is called or is there some other way I should be doing it?



  • LoanBurgerLoanBurger NZMember ✭✭

    I have managed t suppress the CustomTabsConfiguration message by setting the closing message to null; CustomTabsConfiguration.CustomTabsClosingMessage = null; But this does not solve the presenter issue.

  • LoanBurgerLoanBurger NZMember ✭✭


    More on this: I can now confirm this works as expected as long as Google Chrome is the default browser on the phone. If I use the native Samsung browser on my Galaxy S8+ then the browser remains open in the background.

Sign In or Register to comment.