2

We have an app. It does a lot. But the first thing is to sign in to get the name and picture of the user. And we have problem with it.

We have built a website in react and we used 'react-google-login' to sign in the user and get details. But, when we create the build and execute it in cordova, we get error as shown in the code.

gapi.client.load("plus","v1",apiClientLoaded),
gapi.client.plus.pepole.get({
     userId:'me'
}).execute(e)//e is another variable

plus should be loaded and we should be able to access people. But, "people is undefined". We have tried adding 'window' also . No change.

Thank you in advance

Srusti Thakkar
  • 1,835
  • 2
  • 22
  • 52
kalai13
  • 21
  • 3
  • Thank God, Google+ is about to permanently vanish off the face of the earth, so you'll have no need to query the G+ database at all. You should mention that to whoever is making you work on a totally obsolete feature... there are more reliable methods for Social Sign In, like the Firebase APIs. – andreszs Feb 12 '19 at 02:04

1 Answers1

1

First, I would advise not using gapi.client.plus since according to google:

Google+ APIs will be shut down on March 7, 2019. This includes Google+ Sign-in and OAuth token requests with Google+ scopes. Google+ integrations for web and mobile apps will also cease to function March 7, 2019. Learn more. This will be a progressive shutdown, with intermittent failures starting as early as January 28, 2019.

Second, The issue is probably with the client not being loaded when your gapi.client.plus.pepole.get({ userId:'me' }).execute(e) code is executed. Try putting this code in the apiClientLoaded callback that you have provided to the gapi.client.load function.

ManavM
  • 2,918
  • 2
  • 20
  • 33
  • If google+ APIs are to be shut, what else can I be using. My ultimate aim is to get the user's profile pic and name. – kalai13 Feb 11 '19 at 08:09
  • well that depends..since your google plus account is shutting down, you don't have a picture there anymore. However there is a solution here https://stackoverflow.com/questions/25606322/retrieving-a-users-public-google-gmail-picture – ManavM Feb 11 '19 at 09:02
  • Turns out even that is being deprecated. I would recommend going through the [Google Photos API](https://developers.google.com/photos/) to solve your issue – ManavM Feb 11 '19 at 09:04