Prerequisites
Make sure you use BGDatabase version >= 1.7.6 (Settings->Main) and GoogleSheets plug-in version >= 1.5 (Plug-ins->GoogleSheets integration For Editor)
Create Google client Id
Here is our step-by-step guide how to do it (alternatively use this Google support article)
- Log in to Google Console
- Select or create a project
- Enable GoogleSheets API if it's disabled. Wait several minutes after enabling API. ( Google's guide, search for sheets)
- Make sure your project state is "In production" under "Oauth consent screen", otherwise your tokens may expire every week, and you will need to renew them.
- Select
Credentials
, click onCreate credentials
and chooseOath client Id
- Select
Desktop app
and clickCreate
- A popup will show up with your client id and client secret. Copy them to your Datasource settings
- Fill
Application name
with any value - Open up your spreadsheet in your browser, copy the URL, click on
Retrieve from URL
button, paste the URL and click onParse
button to fill Spreadsheet ID (alternatively read this article to learn how to obtain SpreadsheetID)
Get Oath tokens from Google
- Click on
Get new tokens
button - Your browser will open up, with login screen. Login to your Google account.
- At this point warning screen may appear, saying application is not verified. Click on "Advanced" and then "Go"
- Next screen let you grant a permission to access Google Sheets. Click on "Allow"
-
[Last step] After that there are 2 possible scenarios:
Scenario #1
The following page will be displayed in your browser: Close this page and switch back to Unity - tokens values should be updated. Save the settings. The end of the guide.Scenario #2
The following page will be displayed in your browser: In this case, copy URL from browser to text editor and locate thecode
HTTP GET parameter value. Copy it to the clipboard (Ctrl+c). Switch back to Unity Editor, click on "I want to enter code manually" button in the "Google token receiver" window and pastecode
value to "Code" parameter and press on "Go!" button Tokens values should be updated. Save the settings.