4

I am trying to integrate a Google Picker for selecting files from Google Drive following this example.
When opening the picker I get an error in the javascript console and the dialog prompts for a login.

Unable to post message to https://docs.google.com. Recipient has origin https://my-app.herokuapp.com.

When clicking the login button a popup opens and immediately closes again, but nothing happens.

When closing the dialog there is another error in the javascript console

Unknown RPC service: picker 

I am not quite sure what causes these errors or even what to make of it.

Can somebody put me in the right direction?

EDIT
User is logged in to the app. Also, when using "Open with" menu on a file in the Google Drive interface and choose my application, I can access that file.

2
  • Maybe a few details can help? User has not logged in when opening your app, and then in your app initiates the Drive picker opening activity? Does it work once user is logged in and then initiates the Drive picker opening activity? Commented Jun 3, 2012 at 7:26
  • Thanks HelmuthB. Added some clarification. Commented Jun 3, 2012 at 14:38

2 Answers 2

4

You have to add https://my-app.herokuapp.com to the list of authorized Javascript Origins in the APIs Console:

  • go to the APIs Console: https://code.google.com/apis/console/
  • select your project from the dropdown menu
  • open the tab API Access
  • click on Edit Settings for the Client ID for Web Applications section corresponding to your client
  • add the URI to the list of Authorized JavaScript Origins
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your help Claudio. It turned out to be a problem with my Chrome installation. In FF and Safari I can not reproduce this. Sorry for the upheaval and its unrelatedness to the Google Picker.
For the record: The problem was, that "Block third-party cookies and site data" was set to true in Chrome's settings, which makes complete sense. Hope this helps someone.
0

create Picker without ".setOrigin" could give bizarre errors in some browsers.

putting: .setOrigin("https://docs.google.com") could solve.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.