Search code examples
javascriptgoogle-apisencha-touch-2google-plus

gapi.client is undefined:Google plus api within a secha touch 2 application


My app complains that gapi.client is undefined and I don't know why. I have added the path to the api javascript file to my applications app.json file as "path": "https://apis.google.com/js/plusone.js".

The file loads correctly and I can see that gapi is getting defined but the gapi.client isn't getting defined. Any idea why? I have read the javascript api documentation at:https://developers.google.com/+/web/people/


Solution

  • gapi consists of different parts that can be loaded separately.

    plusone.js includes support for various website badges/widgets, but doesn't include the client library.

    If you want to have access to gapi.client you have to load the script https://apis.google.com/js/client:plusone.js