I need for my application to find user contacts from gmail. So I need to use this api from google contacts api
https://www.google.com/m8/feeds/contacts/{userEmail}/full
When I send a GET request to this url I get:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
My question is how can I get the accessToken to request this api with react-native-google-signin? I've already tried
GoogleSignin.getCurrentUser().then(infos => console.log(infos));
I get with this function user informations as name, photo, email... and I get a field idToken but when I add this token to my header request I get always code 403, so I think that isn't the access token.
Can you please help me to find access token or is there any other solution to find contacts directly with react-native-google-signin
Edit: Also tried
GoogleSignin.getTokens().then((res) => { console.log(res); });
but nothing is logged I don't know why