Creé una aplicación web (js) que se conecta con Google. Funciona en PC pero no en móvil. ¡El error indicado es popup_closed_by_user mientras no cerré la ventana emergente! Me gustaria que me ayudaran por favor aqui les dejo un ejemplo:
<!DOCTYPE html> <html lang="en"> <head> <script src="https://apis.google.com/js/api:client.js"></script> <title>Document</title> </head> <body> <h3>warning: there is Script Error bc client id is not entered. this example don't work in stackoverflow code snippet</h3> <h1>name: <span id="namegoogle">not connected</span></h1> <h1>image: <img id="img_google" alt="not connected"/></h1> <button id="customBtn">GOOGLE: click to connect</button> <p>ERROR: <span id="errorgoogle">[NO ERROR]</span></p><br><br><h3>WARNING: CLIENT ID IS NOT DECLARED</h3> </body> <script>var is_google_user_succed_942894 = false; var google_getGivenName = "";var google_getFamilyName = "";var google_getAvatarUrl = ""; var googleUser = {};var startApp = function() { gapi.load('auth2', function(){ // Retrieve the singleton for the GoogleAuth library and set up the client. auth2 = gapi.auth2.init({ client_id: '################################################################################################.apps.googleusercontent.com', cookiepolicy: 'single_host_origin', // Request scopes in addition to 'profile' and 'email' //scope: 'additional_scope' }); attachSignin(document.getElementById('customBtn')); }); }; startApp(); function attachSignin(element) { console.log(element.id); auth2.attachClickHandler(element, {}, function(googleUser) { document.getElementById("namegoogle").innerHTML = googleUser.getBasicProfile().getName(); document.getElementById("img_google").src = googleUser.getBasicProfile().getImageUrl(); }, function(error) { var error_msg = error['error']; document.getElementById('errorgoogle').innerHTML = error_msg; }); } </script><script src="https://apis.google.com/js/platform.js?onload=renderButton" async defer></script> </html>