Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does google-services.json replace default_web_client_id?

First i'd just like to say I have Google play sign in up and working. However I have struggling to understand how a specific line of code works.

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestIdToken(getString(R.string.default_web_client_id))
                .requestEmail()
                .build();

I would like to know how requestIdToken is getting my real clientId.
when investigating: default_web_client_id = 0x7f060035

when i log R.string.default_web_client_id i get: 2131099701

when I log getString(R.string.default_web_client_id) i get: xxxxxxx-xxxxxxxxx0tfctc0fa0a.apps.googleusercontent.com(my web client id)

This id is not located in my strings or resources folder. However it is in my google-services.json file.

My question is how is getString or that default_web_client_id resolving into a clientID in a Json File?

Thanks in advance for the enlightenment!

like image 879
Brent Aureli Avatar asked Aug 08 '16 09:08

Brent Aureli


1 Answers

According to this you apply gradle plugin which then generates new xml file with values from the JSON

like image 152
X3Btel Avatar answered Oct 06 '22 12:10

X3Btel