Issues with the Google Picker API and selecting Google Drive items

I am trying to integrate Google Picker to select files from Google Drive, the following in this example .
When I open the collector, I get an error in the javascript console and dialog prompts for login.

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

When you press the login button, a popup window opens and closes immediately, but nothing happens.

When closing the dialog, another error appears in the javascript console

 Unknown RPC service: picker 

I'm not quite sure what causes these errors or even what to do about it.

Can someone put me in the right direction?

EDIT
The user is connected to the application. In addition, when using the "Open With" menu in a file on the Google Drive interface and select my application, I can access this file.

+2
source share
1 answer

You must add https://my-app.herokuapp.com to the list of authorized Javascript Origins in the API console:

  • go to the API console: https://code.google.com/apis/console/
  • choose your project from the dropdown menu
  • open access API tab
  • click "Change Settings" for the "Client Id for Web Applications" section that matches your client.
  • add a URI to the list of authorized JavaScript sources
+4
source

Source: https://habr.com/ru/post/914604/


All Articles