UnityGoogleDrive | Google Drive SDK for Unity game engine | iOS library
kandi X-RAY | UnityGoogleDrive Summary
kandi X-RAY | UnityGoogleDrive Summary
Google Drive API library for listing, searching, creating, uploading, editing, copying, downloading, deleting and exporting files on the user's drive from within Unity game engine. Supports all the major platforms: Windows, Mac, Linux, iOS, Android and WebGL. AppAuth-Android and AppAuth-iOS native libraries are used to perform authentication on Android and iOS respectively for better user experience; accompanying native client sources: UnityGoogleDriveAndroid, UnityGoogleDriveIOS. PlayServicesResolver dependency file is provided in the distributed package to automatically resolve dependencies.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of UnityGoogleDrive
UnityGoogleDrive Key Features
UnityGoogleDrive Examples and Code Snippets
Community Discussions
Trending Discussions on UnityGoogleDrive
QUESTION
I'm working on an iOS/Android app developed in Unity, that uses Google Sign-in through Firebase Auth, and from what I've read here, that should handle the OAuth 2.0 protocol. I would like to use the Google Drive API to allow the user to load files they have stored in their Drive, but I'm having trouble finding documentation on how to do that in Unity.
The most useful pieces of information are the following GitHub repo and Gist:
- Unity Package for Google Drive API
- Using Firebase to Authenticate to Google Drive (but not specific to Unity)
Any help on how to do it is greatly appreciated.
...ANSWER
Answered 2020-Aug-13 at 04:58For future reference, I ended up using this video to implement Google Sign-in through Firebase in Unity. It was very detailed both on how to set up things from the Firebase side as well as Unity.
As for loading files from Drive, the solution was to use this unity package that allows you to call the native file picker for each platform, being able to load files from all Drive accounts the user logged-in in his/her phone, as well as any other file provider they could have (the phone storage itself, Dropbox...), all in a UI that is familiar to the user. I leave here the issue that led said solution, on another package from the same creator, which, by the way, I have a lot to thank for.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install UnityGoogleDrive
Create Google Drive API app. Parse generic credentials JSON file. full .NET 2.0 profile.
Import the package;
In the Unity editor navigate to Edit -> Settings -> Google Drive; GoogleDriveSettings.asset file will be automatically created at Assets/UnityGoogleDrive/Resources, select the file (if it wasn't selected automatically);
Click Create Google Drive API app button; web-browser will open URL to setup the app: Select Create a new project and click continue; Click Go to credentials; Click Cancel; Select OAuth consent screen tab and enter required info, click Save; Return to Credentials tab and click Create credentials -> OAuth client ID; Select Web application for 'Application type', give your app a name and enter the following restrictions: Authorised JavaScript origins: enter host names which will serve WebGL builds (not required for platforms other than WebGL); Authorised redirect URIs: Add redirect URI for the local loopback requests: http://localhost; Add full URIs to the WebGL builds locations (not required for platforms other than WebGL). Final result may look like that. Click Save; Close the appeared popup and click Download JSON button to get the credentials JSON file.
Return to Unity editor, open Google Drive settings and click Parse generic credentials JSON file; select the downloaded credentials JSON file;
When under .NET 3.5 scripting runtime, make sure to set API compatibility level to the full .NET 2.0 profile (not subset) to prevent JSON parsing issues on AOT platforms.
Manage Google Drive API app. Parse URI scheme credentials PLIST file.
In the Unity editor navigate to Edit -> Settings -> Google Drive, click Manage Google Drive API app web-browser will open URL to manage the console app that was created during the initial setup;
Click Create credentials -> OAuth client ID to add a new OAuth client to be used when authenticating on iOS and Android;
Select iOS for the Application type (it'll still work for both iOS and Android);
Enter anything you like for the Name field (eg, URI Scheme Client);
Enter your Unity's application ID for the Bundle ID field (eg, com.elringus.unitygoogledrive). Make sure your application ID is lower-cased (both in the editor and in the credentials). In case you're unable to change Application ID (eg, app is already published), see FAQ for available workarounds;
Leave the remaining fields blank and click Create button;
Download the credentials file by clicking the Download plist button;
Return to Unity editor, open Google Drive settings and click Parse URI scheme credentials PLIST file; select the downloaded credentials plist file;
Download and install PlayServicesResolver package to automatically resolve Android and iOS native dependencies. The dependency file is located at ./UnityGoogleDrive/Editor/Dependencies.xml. When the PlayServicesResolver is installed and editor is switched to Android build target, all the required .jar and .aar files will automatically be downloaded to the Assets/Plugins/Android folder. When switched to iOS, a CocoaPods Pod file will be added to the generated iOS project on build post-process. When developing under Windows, you'll have to manually run pod install in the XCode project directory to install the iOS dependencies.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page