Page 1 of 1

Need help to use UseGoogleDrive() function

Posted: Sat May 05, 2018 9:35 pm
by ehbarba
Hi everyone

I will appreciate some help to use UseGoogleDrive() function, I can't make it work, nor the GoogleDriveEditor sample, nor with my own Ids...

Is UseGoogleDrive() working at all?

Greetings

Ezequiel

Re: Need help to use UseGoogleDrive() function

Posted: Sat May 05, 2018 11:33 pm
by falsam
I don't use this feature but I did run a test ;)

1 - Go to the Google API Console. https://console.developers.google.com/
2 - Create (or select) a project. Example : My Google Drive
3 - In the displayed list of available APIs, click the link for the Drive API and click Enable API.
4 - When ready ...
5 - Click Credential link
6 - Create an ID clients OAuth 2.0
7 - Create an API Key with HTTP referent website

My test only allows you to view files linked to your account IDs.

The indicator does not work if the debug option is enabled. (Weird behavior)

Code: Select all

; 1 - Go to the Google API Console. https://console.developers.google.com/
; 2 - Create (or select) a project. Example : My Google Drive
; 3 - In the displayed list of available APIs, click the link for the Drive API and click Enable API.
; 4 - When ready ... 
; 5 - Click Credential link 
; 6 - Create an ID clients OAuth 2.0  
; 7 - Create an API Key with HTTP referent website

Global GoogleFileID$

Procedure GoogleDriveReady()
  SetGadgetText(0, "Google drive is ready")
  DisableGadget(1, #False)  
EndProcedure

Procedure RequesterSuccess()  
  While NextSelectedFile()
    GoogleFileID$ = SelectedFileID()
    ;Your code
  Wend
EndProcedure

Procedure ButtonEvent()
  OpenFileRequester("", @RequesterSuccess(), #PB_Requester_GoogleDrive)
EndProcedure

;My google id : 938941994242-v7en6e0kuokmmir09edalkorkeqjm3ke.apps.googleusercontent.com (Remove .apps.googleusercontent.com)
Define ClientID.s = "938941994242-v7en6e0kuokmmir09edalkorkeqjm3ke"
Define APIKey.s   = "AIzaSyCj-rxh8PQdHIyTzPl8hzuQ_nwxT32nsis"

UseGoogleDrive(ClientID, APIKey, @GoogleDriveReady())

If OpenWindow(0, 10, 10, 400, 100, "Google Drive")
  ButtonGadget(1, 10, 10, 170, 25, "Open file...")
  DisableGadget(1, #True)
  TextGadget(0, 10, 70, 380, 22, "")
  BindGadgetEvent(1, @ButtonEvent())
EndIf
:arrow: Demo : http://falsam.com/sbtest/drive.html

Re: Need help to use UseGoogleDrive() function

Posted: Sun May 06, 2018 3:15 am
by ehbarba
Hi falsam

Thank you very much for taking the time to respond to this post.

I tried your demo (previously disabling the debugging option) but the google window shows the same error again. What could be happening?

Image

Re: Need help to use UseGoogleDrive() function

Posted: Sun Feb 18, 2024 2:17 pm
by umueller
Need help with usegoogledrive()

The usegoogledrive() function does not work for me.
I have created the API key and the IdentID at https://console.developers.google.com/.

I created the ClientID for android and web.

Unfortunately, I have no way of accessing the account. Does anyone have any positive experience with this function?

It is also possible to create a ClientID for desktop computers. Has anyone experimented with this?

I am very grateful for any feedback.