ToS and Privacy policy links in sign-in with Google not working

Viewed 367

I have implemented the firebase authentication UI including the email and Google as providers. I have also included the ToS and privacy policy links as follows:

List<AuthUI.IdpConfig> providers = Arrays.asList(
                    new AuthUI.IdpConfig.EmailBuilder().build(),
                    new AuthUI.IdpConfig.GoogleBuilder().build());


            // Create and launch sign-in intent
            startActivityForResult(
                    AuthUI.getInstance()
                            .createSignInIntentBuilder()
                            .setTosAndPrivacyPolicyUrls(
                                    "https://test.com/terms-and-conditions/",
                                    "https://test.com/privacy-policy/")
                            .setLogo(getApp().isDemoApplication() ? R.drawable.log1 : R.drawable.log2)
                            .setTheme(R.style.LoginTheme)
                            .setAvailableProviders(providers)
                            .build(),
                    RC_SIGN_IN);

The links work perfectly fine in the first page but when I choose the Google option for authentication, then the links in the popup do not work and keep showing the toast saying "No browser found to open this link."

I have followed the instructions to reset my apps configurations, also reset my phone(s) and changed my default browser to chrome. But none of them solved the issue. I have tested this on two android phones; Sony Xperia with android 10 and Samsung Galaxy s8 with android 9.

Is there any settings I missed in my AuthUI or in my app?

2 Answers

as I see your are using an old version.

You can follow this guide to use the last version without "startActivityForResult". https://firebase.google.com/docs/auth/android/firebaseui

I had the same problem when I used the URL´s without "https://". Is the code you posted an example or is the real one?

Related