google-drive-apigoogle-picker

Problems with Google Picker API and selecting Google Drive items


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.


Solution

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