", "text": "<p>When running my angular (ionic framework) app locally, via a browser all works well but when running via android studio or packaged and pushed into the mobile phone I get a 403.</p>\n<p>This is on this line on the index.html:\n<code><script src="https://accounts.google.com/gsi/client" async defer></script></code></p>\n<p>I am trying to integrate/implement "Sign In With Google" button as per this page: https://developers.google.com/identity/gsi/web/guides/client-library</p>\n<p>Any pointers?</p>\n<p>Thanks in advance!</p>", "answerCount": 1, "upvoteCount": 260, "dateCreated": "2026-05-03 07:40:08", "dateModified": "2026-05-05 20:12:46", "author": { "type": "Person", "name": "ThaBlip" }, "acceptedAnswer": { "@type": "Answer", "text": "<p>I have run into the same issue in REACT..</p>\n<p>the solution to my problem was to add /* global google */ above the google.accounts.id .</p>\n<p>/* global google */ by putting this line above our code, it will automatically refer to the script inside the index.html file.</p>\n<p>React.js example</p>\n<pre class="prettyprint"><code>import './App.css';\nimport { React, useEffect } from 'react'\nimport jwt_decode from 'jwt-decode'\n\nfunction App() {\n\n function handleCallbackResponse(response) {\n var userObject = jwt_decode(response.credential);\n console.log(userObject);\n }\n useEffect(() => {\n\n /* global google */ <-- Add this line before calling google.accounts.id\n\n google.accounts.id.initialize({\n client_id: "Your Client ID here",\n callback: handleCallbackResponse\n })\n\n google.accounts.id.renderButton(\n document.getElementById("signInDiv"),\n { theme: "outline", size: "large" }\n );\n\n return () => {\n }\n }, [])\n\n\n return (\n <div className="App">\n <div id="signInDiv"></div>\n </div>\n );\n}\n\nexport default App;\n</code></pre>", "upvoteCount": 195, "url": "https://exchangetuts.com/index.php/android-403-for-script-srchttpsaccountsgooglecomgsiclient-async-deferscript-1766631002879444#answer-1778053208524228", "dateCreated": "2026-05-05 08:12:46", "dateModified": "2026-05-05 20:12:46", "author": { "type": "Person", "name": "ALBIN JO ALEX" } } } }