4

I've got a few problems with Google Picker that I just can't seem to solve.

Firstly, I have a problem with signing into my google account via the google picker window (as reported here https://groups.google.com/forum/#!topic/google-picker-api/3VXqKO1BD5g and elsewhere). In short, the picker works perfectly up until the point where it returns from the sign-in action. It fails to load the picker view once the account is signed in. The actions taken are as follows:

  1. Open Google picker
  2. Receive not signed in page, with sign in button.
  3. Button opens a new window for google sign in.
  4. Enter details and sign in. The sign in is successful.
  5. Sign in window closes, and focus returns to the google picker, but it fails to recognise the sign in, receiving instead the above mentioned "The feature you requested is currently unavailable. Please try again later." error. With a js ReferenceError: init is not defined

Secondly, I have a problem in IE10 where the browser will show the "you are not signed in" screen even if I am. Clicking the button will open the sign-in window which closes immediately (sign in recognised?), but nothing happens on the google picker window.

The example found here: http://www-personal.umich.edu/~johnathb/misc/gpicker.html Seems to work just fine on IE10. So I am not sure what the problem is.. Possible differences are:

  • I have Https enabled on my site (but it didn't seem to make a difference when turned off).
  • I am currently running my app within an intranet (with internet access though).
  • Something to do with public IPs or such? But this wouldn't explain why the Google Picker works in Firefox etc.

The code used to load and handle the picker is shown below:

$('.googleDrivePicker').click(function () {
    var inputControl = $(this).data('inputid');
    // Google Picker API for the Google Docs import
    google.load('picker',
        '1',
        {"language": '@Session["kieli"]',
            "callback" : function () {
            // Create and render a Picker object for searching images.
            var picker = new google.picker.PickerBuilder().
                addView(google.picker.ViewId.DOCS).
                addView(google.picker.ViewId.IMAGE_SEARCH).
                setCallback(function (data) {
                    // A simple callback implementation.
                    var url = '';
                    if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) {
                        var doc = data[google.picker.Response.DOCUMENTS][0];
                        url = doc[google.picker.Document.EMBEDDABLE_URL] || doc[google.picker.Document.URL];
                        $('#' + inputControl).val(url).change();
                    }
                }).
                build();
                picker.setVisible(true);
                $('.picker.modal-dialog-bg').css('z-index', 1101);
                $('.picker.modal-dialog.picker-dialog').css('z-index', 1102);
            }
        });
    });

Would really appreciate help with either of the above problems.

Kara
  • 6,115
  • 16
  • 50
  • 57
Miika L.
  • 3,333
  • 1
  • 24
  • 35
  • I encountered similar problems when the button for opening the picker was an which made the page also refresh on click. Maybe this helps – Radu Simionescu Apr 11 '13 at 08:55
  • The Google Picker API dev team recently made a blog post saying that, a picker button is also a sign-in button; which means that if not signed in, it will also cause the sign-in flow by calling the sign-in callback. Make sure that the sign-in callback function (if present) is correct and works with sign-in button. – akarthik10 Jan 14 '14 at 14:17

0 Answers0