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
Demo :
http://falsam.com/sbtest/drive.html