title: Google Sign in doesn't work only for web mobile
body: <p>My site is implementing Google Sign-In with the code below and it's working pretty well.</p>
  <p>When I try to do it in the mobile version, it works, but I don't get the answer of sign in. I guess it's because mobile version doesn't show a popup but a new tab (Facebook has the same behavior as well...)</p>
  <p>How should I proceed to get it to work in the mobile version too?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>gapi.load('auth2', function() {});
  
  $(function() {
    $("#btn-google-login").on('click', function() {
  
      var proccedLogin = function(resp) {
        // my continue code...
      }
  
      // Retrieve the singleton for the GoogleAuth library and set up the client.
      auth2 = gapi.auth2.init({
        client_id: $('meta[name="google-signin-client_id"]').attr('content'),
        cookiepolicy: 'single_host_origin',
        prompt: 'consent',
        immediate: false
      }, function() {});
  
      auth2.signIn()
        .then(proccedLogin)
        .catch(function(error) {
          alert(JSON.stringify(error, undefined, 2))
        })
  
    }) // btn google click
  })</code></pre>
  </div>
  </div>
  </p>
  <p>P.S. The error I get is 'popup_closed_by_user', but I didn't closed the tab by my own.</p>
  <p><strong>Edit</strong></p>
  <p>Now I'm getting 'popup_blocked_by_browser'. I followed some changes described in the link below but it just returns the same error...</p>
  <p><a href="https://stackoverflow.com/questions/45624572/detect-error-popup-blocked-by-browser-for-google-auth2-in-javascript?noredirect=1&amp;lq=1">detect error: &quot;popup_blocked_by_browser&quot; for google auth2 in javascript</a></p>