سؤال

I'm trying to make Google+ Over-The-Air Installs working (https://developers.google.com/+/web/signin/android-app-installs)

I added Client ID for my Android app and for web app into Google apis frontend and added data-apppackagename parameter to button. I would expect new dialog box appear right after regular G+ log-in dialog.

Is anybody got this feature working??!

My html:

<script>AsyncRequest('https://plus.google.com/js/client:plusone.js?onload=start')
    function signInCallback(authResult) {
        if (authResult['code']) {
            alert('oki-doki');
        }
    }
</script>
    <!-- Add where you want your sign-in button to render -->
<div id="signinButton">
  <span class="g-signin"
    data-scope="https://www.googleapis.com/auth/plus.login"
    data-clientid="XXXXXX"
    data-redirecturi="postmessage"
    data-accesstype="offline"
    data-cookiepolicy="single_host_origin"
    data-apppackagename="com.tfd.mobile.TfdSearch"
    data-callback="signInCallback">
  </span>
</div>
<div id="result"></div>

ADDED:

Does I right understand that over-the-air install window should appears right after auth popup and before my signInCallback js got fired?

هل كانت مفيدة؟

المحلول

I just added some troubleshooting info to Over the air installs page that might help out. It does look like your app should meet the qualifications required for the feature to be available.

My guess is that Google Play store believes that you have the app installed or possibly still have it on another device that you use and so its not triggering. It could also be that you tried it out and the system was still caching that you had it installed.

نصائح أخرى

If your app is new, or still in development, it may not trigger the Over-the-Air Install feature, yet. There is a minimum "quality" threshold that the app must meet before the dialog will trigger. This threshold is determined by the Android Play Store. If your app is new, then you can set up the install feature by adding in the package name, and it will trigger the dialog in the future once your app passes the threshold. In the meantime, you can be assured that by adding the correct package name, the set up is complete.

Apart from the ones mentioned above, another reason could be the OAuth keys being generated from different Google Projects.

I was using the keys from two different projects and it did not work. Then I changed both the Web "Login with Google" Web Client Keys and Android OAuth API keys from the same project, and it worked.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top