Android Question Catch 22 - READ_CONTACT & GET_ACCOUNTS

Robert Valentino

Well-Known Member
Licensed User
Longtime User
In a pre-launch report from Google I got the following message


NOW the only reason I have READ_CONTACTS is so I can get a list of the users emails to verify that they are logged in with their default Google account.
If I remove READ_CONTACTS I cannot get a complete list of the user emails. I am doing this on Android 10 & 11

You would thing that GET_ACCOUNTS permission would be enough to get the users email accounts but it only seems to return the one they are logged in on.

Would love to get rid of both READ_CONTACTS and GET_ACCOUNTS

Is there a way to get the default google account (1st account) or when I have them log in using Firebase have the default account picked?

IN-CASE someone is wondering
I have had users that have subscription problems if they purchase products with different default Google accounts
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Yeah Right. I am the one providing support to figure out why their subscriptions aren't working when they switch to a different device (some of my users have 8 or more emails) and they forget to put the one they used to buy in or as the default and their subscriptions don't come down.

Turns out it looks like maybe Google has a function (or a sign in option) to sign the user in with a default account Default Sign In
public static final GoogleSignInOptions DEFAULT_SIGN_IN Default configuration for Google Sign In.
But this feature isn't part of our FirebaseAuth code and I have no idea how to sign them into Google with this option

If I could sign in with the DEFAULT_SIGN_IN (assuming this means what I think it does) account then I would not need READ_CONTACTS or GET_ACCOUNTS at all.

More research needed


UPDATE: Found these examples on how to do this DEFAULT_SIGN_IN, is there anyway to get this into FirebaseAuth?
 
Last edited:
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well after spinning my wheels most of the morning I now believe the DEFAULT_SIGN_IN is not going to do what I want.

Wish there was some way to just pick the 1st account automatically when displaying the user accounts.
On all the device I have tried.
The first account that comes up using FirebaseAuth to sign into Google is the one I want.
Will keep researching this. Can't believe there is no way to just pick the first account.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…