Giter Site home page Giter Site logo

elringus / unity-google-drive Goto Github PK

View Code? Open in Web Editor NEW
386.0 17.0 63.0 2.55 MB

Google Drive SDK for Unity game engine

Home Page: https://forum.unity.com/threads/515360

License: MIT License

C# 96.85% Objective-C++ 1.43% Shell 0.12% Java 1.59%
multiplatform google-drive unity3d unity3d-plugin google-drive-api google-api-client oauth2

unity-google-drive's Introduction

Installation

Use UPM to install the package via the following git URL: https://github.com/elringus/unity-google-drive.git#package or download and import UnityGoogleDrive.unitypackage manually.

In case you're not familiar with the Google Drive API, please read through the official documentation and FAQ, before using this package or opening new issues.

Description

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.

Three authentication schemes are used: browser redirection for WebGL builds, custom URI for iOS/Android and local loopback requests for other platforms. All the credentials are stored in a scriptable object; editor script provides shortcuts to create and manage Google Console App, allows to parse credentials JSON to skip manual copy-pasting and edit common settings:

Settings

Automated integration tests cover the main features:

Tests

Limitations

  • 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.
  • Make sure 'Managed Stripping Level' in no higher than Low; otherwise, necessary JSON parsing will not work and the plugin may misbehave in builds while working fine in the editor.

Setup (editor, standalones and WebGL)

  • 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;
      • Fill in all of the details of your project and then continue to the next step
    • On Dashboard click the ≡ menu icon and select APIs & Services
    • From the menu on the left side of your screen select OAuth consent screen tab, choose User Type and click Create;
    • Insert necessary information and click Save and Continue (After this you will see Scopes tab, at this point just click Cancel)
    • Navigate to Credentials on the menu on the left side of your screen 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;

Additional setup for iOS and Android

  • 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.

Access Scopes

By default, the most permissive access scope is set, allowing to use all the available drive APIs. You can restrict the scope in the settings menu, but be aware that it could prevent some of the features from working correctly.

Examples

The design mostly follows the official Google APIs Client Library for .NET:

// Listing files.
GoogleDriveFiles.List().Send().OnDone += fileList => ...;

// Uploading a file.
var file = new UnityGoogleDrive.Data.File { Name = "Image.png", Content = rawFileData };
GoogleDriveFiles.Create(file).Send();

// Downloading a file.
GoogleDriveFiles.Download(fileId).Send().OnDone += file => ...;

// All the requests are compatible with the .NET 4 asynchronous model.
var aboutData = await GoogleDriveAbout.Get().Send();

For more examples take a look at test scripts.

Implemented APIs

The following Google Drive APIs are currently implemented:

FAQ

What's wrong with Google's official .NET API client?

When this plugin was initially created, the official SDK didn't work with Unity; now that Unity supports .NET 4.5 it could work, though it's still not officially supported. In case you don't need additional features the plugin provides (platform-specific auth options, credentials manager, Unity-related helper methods), by all means use the official SDK instead, as it's much more mature and covers the whole API.

Why some of the returned properties of the response are null?

Majority of the response properties are null by default. Properties must be explicitly required in order for the drive API to return them (using Fields property of the request object). More information here: https://developers.google.com/drive/v3/web/performance#partial.

How to access a file using its path?

A folder in Google Drive is actually a file with the MIME type application/vnd.google-apps.folder. Hierarchy relationship is implemented via file's Parents property. To get the actual file using its path, the ID of the file’s parent folder must be found. To find ID of the file’s parent folder, the IDs of all folders in the chain must be retrieved. Thus, the entire hierarchy chain must be traversed using GoogleDriveFiles.List requests.

The naive implementation of the aforementioned logic via Unity's coroutine can be found in the example script and used as a reference for your own solution; also, take a look at the built-in async helpers FindFilesByPathAsync and CreateOrUpdateFileAtPathAsync (requires .NET 4.x).

More information on the Google Drive folders: https://developers.google.com/drive/v3/web/folder.

Is it possible to download/upload large files in chunks to reduce memory usage?

To perform a partial download you have to supply downloadRange argument for the GoogleDriveFiles.Download request specifying the bytes range you wish to get. Here is an example script for a partial text file download. More info on partial downloads can be found in the API docs.

For the chunked uploads you'll have to use resumable upload requests in a special manner. First, create a resumable upload request (via either GoogleDriveFiles.CreateResumable or GoogleDriveFiles.UpdateResumable), supply the file's metadata, but don't set the file's Content property (make sure it's null). Send the request and get a resumable session URI from the response. Now you can use the session URI to upload the file's content in chunks. See the Drive API docs for detailed instructions on how to perform a chunked upload using a resumable session URI.

Is there a way to automatically redirect user to the app when authorization in browser is complete?

When using custom URI authentication scheme on iOS/Android, redirection will be handled by the native libs automatically. On WebGL the redirection is also performed automatically. When user finishes authorization flow using loopback scheme, an HTML string is injected to the active browser window. The default content of the HTML contains a message, asking user to return to the app. You can modify the content of the injected HTML in the Google Drive Settings asset using Loopback Response HTML field. It’s possible to inject a JavaScript code to this HTML, which will be invoked right after the auth flow is completed. You can use this option to automatically redirect user back to your app using a custom URI scheme. Specific implementation will depend on the platform; eg, for Windows bind the application to a URI scheme.

How to logout or force user to login/select another Google account?

Use GoogleDriveSettings.DeleteCachedAuthTokens method to clear cached authentication tokens which will force the user to login again on the next request. You can always get GoogleDriveSettings instance using GoogleDriveSettings.LoadFromResources static method. While in editor, you can also use 'Delete cached tokens' button for the same effect.

Is it possible for users to access my Google Drive account and use it as a database for my app?

It's not possible. Google Drive is personal/team storage, not a replacement for a database. To access a Google Drive account, it's mandatory to complete OAuth procedure for the user the account belongs to, which requires opening a browser window to login and allow the app to access their drive. It's a security measure enforced by Google.

Is it possible to use an embedded browser (WebView) for the authorization?

It’s not possible. Google is intentionally blocking authorization requests sent from any sort of embedded browsers for security reasons.

Is it possible to access shared files and folders?

This is possible. To access shared resources you'll have to specify "Shared with me" collection when resolving ID of the resource. Additionally, if the shared resource has been added to the user's drive it'll be accessible via the path finding method described above.

My application ID (Android/iOS) is mixed-cased and I can't change it.

Application ID (aka bundle ID, package name) is used as a custom URI scheme on Android and iOS to receive authorization callback from Google’s OAuth server and redirect user back to the app. Even though the initial request sent by UnityGoogleDrive plugin preserves casing of the application ID (as it’s set in the player settings), Google’s OAuth server will forcibly convert it to lowercase when redirecting the user. That’s why it’s mandatory to use lowercased application ID. If, however, you’re unable to change it (eg, app is already published on the store), you can do the following:

  • Android: replace ${applicationId} record in the {PackageRoot}/Plugins/com.elringus.unitygoogledriveandroid.aar/AndroidManifest.xml (you’ll have to unzip the .aar) to your application’s ID (lower-cased);
  • iOS: add your application’s ID (lower-cased) to the Supported URL schemes list in the iOS player settings.

UWP authentication fails on redirect.

UWP dropped support for local loopback scheme. Custom URI scheme is expected to be used instead. If you're interested in adding support for that, check out the related issue.

unity-google-drive's People

Contributors

anmolbajajnet avatar drunkar avatar elringus avatar mattlichter avatar mmonfils avatar nicolasboattini avatar robyer1 avatar rytir2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-google-drive's Issues

Unable to use it with the PC standalone game

I am using this asset package to upload the data on my google drive. It is working in the editor, I am able to upload all the files when playing the game in Editor. But it doesn't work with the PC standalone build. When I played the exe file, the screen got stuck and and in browser a page was opened (behind the scenes) to ask for permissions. Usually I would expect the browser window to be popped up so that I be able to grant permissions, but no such thing happened. Instead my game screen froze and ultimately I had to force quit. This happens everytime I run the game, even if I have already given the permission by visiting this URL

iOS authentication is failing in latest version

This was working fine, but coming back to retest now (after all the new features), the iOS authentication is failing now.

Failed to execute authorization procedure. Check application settings and credentials.

We tried changing to 4.6 scripting - but that breaks the entire app on iOS and downloads stop working on Android :(

Please advise how best to debug and fix this?

Joe

Android browser redirection issues when performing auth

Hello again. It's been a while. I've been using your plugin for a long time and i've got to say - it works almost perfectly. The time and effort you put into this is amazing. I've got a few questions about this plugin, which I couldn't answer myself and I hope you can help me :)

  1. Is there a way to know if a user has cancelled or timedout the request? Because every time i cancel an auth request i get an error and the whole app just freezes.

  2. Does this plugin support token saving (So that i wont have to log back every time)? My app starts the whole auth procedure quite frequently. (like 15 minutes after logging in I restart my app and have to log in again)

Anyways, without this plugin, I probably would have been at a loss, so thanks you. Take care!

Helpers.FindFilesByPathAsync Not Returning New Files

I'm using Helpers.FindFilesByPathAsync to return a list of files from a specific folder on my Google Drive. At first it seemed to be working just fine, returning every file in the folder. Then I created a new file within the folder, and it does not recognize this new file. I've waited >24 hours assuming Google Drive APIs have some kind of delay, and yet the file is still not being picked up.

When I delete or move an older file from within the folder it is no longer picked up, and if I turn on the trash flag it will pick up old deleted files, but it will not pick up any new files. I also tried making exact copies of old files, and still no luck.

Is there a local cache that UnityGoogleDrive makes that I'm unaware of?

Android Auth Issues

On Android I am not getting an auth screen.

It works fine on iOS. Below is error log.
No idea when this issue crept in. I found that play service resolver was not correctly downloading dependencies, but I fixed that.

12-24 09:13:19.233 24816 24836 E Unity : at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) [0x0 12-24 09:13:19.522 24816 24836 E Unity : AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetResponseListener' signature='(Lcom.elringus.unitygoogledriveandroid.AuthorizationActivity$OnAuthorizationResponseListener;)V' in class Lcom.elringus.unitygoogledriveandroid.AuthorizationActivity; 12-24 09:13:19.522 24816 24836 E Unity : java.lang.NoSuchMethodError: no static method with name='SetResponseListener' signature='(Lcom.elringus.unitygoogledriveandroid.AuthorizationActivity$OnAuthorizationResponseListener;)V' in class Lcom.elringus.unitygoogledriveandroid.AuthorizationActivity; 12-24 09:13:19.522 24816 24836 E Unity : at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:49) 12-24 09:13:19.522 24816 24836 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 12-24 09:13:19.522 24816 24836 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0) 12-24 09:13:19.522 24816 24836 E Unity : at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source:151) 12-24 09:13:19.522 24816 24836 E Unity : at android.os.Handler.dispatchMessage(Handler.java:104) 12-24 09:13:19.522 24816 24836 E Unity : at android.os.Looper.loop(Looper.java:166) 12-24 09:13:19.522 24816 24836 E Unity : at com.unity3d.player.UnityPlayer$c.run(Unknown Source:20) 12-24 09:13:19.522 24816 24836 E Unity : at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jcla 12-24 09:13:20.528 24816 24874 E Unity : java.io.EOFException 12-24 09:13:20.528 24816 24874 E Unity : 12-24 09:13:20.528 24816 24874 E Unity : (Filename: Line: 390) 12-24 09:13:20.528 24816 24874 E Unity : 12-24 09:13:20.773 24816 24868 E Unity : java.io.EOFException 12-24 09:13:20.773 24816 24868 E Unity : 12-24 09:13:20.773 24816 24868 E Unity : (Filename: Line: 390) 12-24 09:13:20.773 24816 24868 E Unity : 12-24 09:13:59.802 24816 24836 I Unity : Rebuilt 12-24 09:13:59.802 24816 24836 I Unity :

Redirect

Hello. I've been using this plugin for a while now, and I have to say it works like a charm. I just wanted to ask is there a way to redirect the user back to the application after login? Thanks in advance :)

Closing the browser

Hello again. Right now I have just one bug left to erase, before this plugin starts working perfectly (for me at least), so because of that, I'm here to ask for help. You see, when I click login and don't click Accept nor Deny, everything seems okay, but if I try to click Login one more time, it just doesn't do anything. I can click the Login button in my application as much as I want, but literally nothing happens. I wonder if you know what could cause this type of behavior? Thanks in advance.

Add URI auth scheme support for UWP

In UPW build, after I press Allow in browser, it redirects me to localhost. And nothing happens.
image

BTW I can confirm your plugin works in Editor, Android, iOS and macOS. UWP is the last boss for me, so I will thank you for any help and tips =)

Android redirection issues

Hello,
First I want to say again thank you for this plugin.
As said in the title I have a issues with the redirection. After the authentification it don't go back to the app.

I followed the tutorial instruction and I have create 2 OAuth client ID (a web app and iOS).
But when I authenticate it seems use the web app OAuth (because the name that appears is the name of the web app). Is this normal ?

What should I do for after an authentication go back to the app?
Here is a screen of the google drive settings if it can help.

Thanks.

AppData

Hello, i just have one question: is it possible to upload to and/or download from appdata folder in google drive? Thanks in advance :)

Callback from authorization

Hi! My scenario:

  • remove app data on Android (or perform Google Drive logout)
  • make the first Google Drive call (List in my case), redirection to account selector happens
  • close account selector window (without selecting an account)

Expected result:

  • request.IsError = true, request.error = "User cancelled."

Actual result:

  • nothing happens (my app is stucked on Loading... screen, UI is blocked)

Also I expect request.IsError = true if authorization process is cancelled anywhere later (wrong account, wrong password, no internet connection, permission denied, i.e. when we return to the app without success).

iOS Authentication Error

I started working with his SDK and it worked perfectly for the editor and Android, however when I tried using it in iOS everything died.
It calls the login screen, an when you are supposedly logged, it redircets you to Google instead to the redirect uri, i. e the one that says "return to the app"
Also 2 errors are displayed in the console:

#1
UnityGoogleDrive: OAuth authorization error: Error: The Operation coudldn't be completed (org.openid.appauth.general error-4.)
UnityEngine.DebugLogError(Object)
UnityGoogleDrive.IOSAccessTokenProvider.HandleResponse(string)

#2
UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials.
UnityEngine.DebugLogError(Object)
UnityGoogleDrive.AuthController.HandleAccessTokenProviderDone(IAccessTokenProvider)

A few more questions.

Alright, despite that error, I have a few more questions for you:

  1. What if the user closes the auth window witchout clicking "accept" or "deny". In this case request is not done, but it is not an error either?

  2. Can I change the loopback repsonse html text? My app features multiple language suppor and I want to make the response text according to the current user language.

Thank you in advance, and continue being awesome :)

Cannot get current activity

I am having null ref exception for the following line
var applicationActivity = applicationClass.GetStatic<AndroidJavaObject>("currentActivity");
am I missing anything?

DownloadRequest Progress not working

I'm downloading my large files in 512k chunks. I'm using DownloadRequest.Progress to monitor progress of the chunk download every second. The issue is that Progress remains a zero for the entire chunk download (sometimes up to 10 or more seconds worth), only occasionally do I get a non zero value as the last very last Progress reading before the chunk download is actauly completed.

I'm using WebRequest.uploadProgress for monitoring upload progress for each chunk and it's working perfectly.

Is Progress implemented correctly? Is there a reason it's not reporting progress over the course of the download?

Permissions Implementation

Implementing permissions would be of great help
I tried doing it myself once again, but it takes a long time to understand how this works due to the many abstraction layers.

Support for resumable uploads?

Might be a silly question, but I can't figure out if this supports resumable uploads? If it does, could someone post an example?

Thanks

Joe

How to find (download) a file using it's name?

Hello. I've tried out this plugin and it works amazing! But I have just one problem: there is only an option to download a file using fileId, but can i find a file by its name and download it that way? Thanks in advance :)

Making requests from Oculus GO

Hi, I'm creating an app for Oculus GO (Android) and I'm using the plugin to download some images and use them as slides for a presentation. When I do the listRequest it opens the online browser and opens the Google login page, when logged it says the app needs offline access.

When I click Allow it gets back to Google and I have to reopen manually the app, but the list is not visible. As it is a special type of Android it may need a different type of callback to get the information correctly... Any ideas?

Crashing

Hello. I have downloaded the latest version of this plugin and did all the steps to make it work on android. The problem is, as soon as i try to login with Google Drive, my app jus crashes. I don't know what to do. Thanks in advance!

UWP Hololens issues

Hi Elringus

I'm currently trying to create an AR unity project that will run on the Hololens with Google Drive integration.

After I downloaded a zip of your repo, I tried building the project as:
PC, Mac, & Linux Standalone
This option works and i was able to generate an .exe file

However, when I changed the platform to UWP specialising in hololens, I received errors such as the one below:

capture

Was just wondering if the UnityGoogleDrive is compatible with AR focused projects?

Some errors

Hello. I've updated Unity to the 2019 alpha and I'm getting some errors from this plugin. (.net 4x)

Assets\UnityGoogleDrive-master\Assets\UnityGoogleDrive\Editor\GoogleDriveSettingsEditor.cs(51,78): error CS1503: Argument 2: cannot convert from 'string' to 'System.Func<UnityEditor.Editor>

Assets\UnityGoogleDrive-master\Assets\UnityGoogleDrive\Editor\GoogleDriveSettingsEditor.cs(52,77): error CS1061: 'AssetSettingsProvider' does not contain a definition for 'CreateEditor' and no accessible extension method 'CreateEditor' accepting a first argument of type 'AssetSettingsProvider' could be found (are you missing a using directive or an assembly reference?)

Assets\UnityGoogleDrive-master\Assets\ThirdParty\UnityCommon\Editor\PackageExporter.cs(66,32): error CS7036: There is no argument given that corresponds to the required formal parameter 'scopes' of 'SettingsProvider.SettingsProvider(string, SettingsScope, IEnumerable)'

Hope you can help :)

Is there Logout function?

Hi, in this SDK have a function for logout after Auth? I was tested but I can't found it, can you help!?

Malformed multipart body

As of 07/11 something must have changed in the google drive api or backend since any upload (either creation or update) is returning a malformed multipart body error.

This didn't occur yesterday, or even this morning

Running Example code to test configurations

Hi!
I am currently configuring your package to eventually upload data from a VR application to google drive. Are there example scenes / scripts I can run (or a tutorial to follow) to test to see if I have installed correctly?

Thanks,
Harrison

how to download file

hi! i already figure it out how to upload .db files, my only problem is how can i download it and save it to a specific folder?

Add an option to request `drive.appdata` scope to access AppData folder

Hello again, I'm not trying to be annoying, but i've spent some time trying to figure out how appdata folder works. In unity it shows me bunch of errors when i try to list of upload a file to drive. I've read that you need to request appdata scope in order to access it. I'm just wondering, perhaps you could help me figure this out, because I'm really not good with Goole Drive stuff yet :) Thanks in advance.

Just want to thank you =)

I'm making Pixel Studio, mobile pixel art editor. Hope I will be able to make cross platform gallery sync with your plugin soon!

BTW, you could add await examples as seems it works just fine with Unity 2019

var file = await GoogleDriveFiles.Download(id).Send();

It's much better than coroutines as you can return values when operation completes.

Also I had some difficulties with calculating check sum, I think you can add this feature to the plugin.

public static string ComputeHash(byte[] inputBytes)
{
var hash = MD5.Create().ComputeHash(inputBytes);
var stringBuilder = new StringBuilder();

for (var i = 0; i < hash.Length; i++)
{
stringBuilder.Append(hash[i].ToString("X2"));
}

return stringBuilder.ToString().ToLower();
}

Native feel

Hi,

First of all, thanks for the really nice plugin.

  1. I would suggest separate out the Application.OpenURL call, and the LoopbackResponseHtml response, so if a user is using any other web browser plugin within his game/application can take the benefit of that browser and give the feel of a native work to their users.
    Like I'm using UniWebView plugin so I should have to get the benefit of it and even I can close the browser when it is authenticated.

What do you say?

  1. In OnDone after Download file, there are a lot of properties which remain null, just a few are set. Not even FileExtension and FullFileExtension

  2. In List call, files are returned from the team drive, not my personal drive

  3. Can you make a call, which returned PDF files from my Drive and on a selection of any PDF file downloads it

  4. You are not returning any error in case of error, to know whether the call is successful or not. The only way is to see the exception in the console

IOS

hi there, i m built the app successfully for the android, while building for IOS i m stuck with the error "AppAuth.h" file not found. can you please help me out to resolve this issue.

Switch to Unity's native JSON parser

Currently, a third-party library (Json.Net.Unity3D) is used to de-/serialize JSON data, since Unity’s built-in one doesn’t support nullable types (and they’re heavily used in the data API to represent properties not included to a request/response). While the library itself works fine, it doesn't support .NET 2.0 subset profile and the performance is not that good compared to the Unity's JsonUtility. Maybe someone has an idea how to make nullable types work with the Unity’s JSON tool without complicating code base too much?

iOS Authentication Issues

Hello Elringus.

I am getting this error when running on iOS.

UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials. UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider) UnityEngine.AsyncOperation:InvokeCompletionEvent()

Settings are correct as it is working on Android.
Any ideas?

Security notice from Google

Hello. I have a rather weird question. Every time I log in using this plugin I get a security notice in my gmail telling me someone logged into my account when other apps that use authentication with Google don't get this behavior. Is it possible to remove these notices? Thanks in advance.

Redirecting to google.com after allow access

I have followed all the documentation and it works perfectly on the unity editor. But on an android device, it asks for access, and if i press allow it redirects me to google.com rather than the loopback uri. I made sure my package name is all in lowercase. Some help would be very appreciated.

upload file to shared folder

hi there, i want to upload file to shared folder please tell me how can i do that. i got confused with example scene "GetFileByPath"

Check if already authorised?

Hello @elringus, Firstly thanks for the awesome project, easily integrated into my project.

I would like the user to click a button to authorise, but to hide this button if already authorised. Is it possible to check if authorised without sending the auth request?

The type or namespace name `Data' could not be found. Are you missing an assembly reference?

Hi,
when trying to run the test code

    var file = new Data.File() { Name = "Image.png", Content = rawImageData, MimeType = "image/png" };
    GoogleDriveFiles.Create(file).Send();

, unity complains "The type or namespace name `Data' could not be found. Are you missing an assembly reference?"

My script adds the namespaces

using System.Data;
using Mono.Data.Sqlite;
using Mono.Data.SqliteClient;

Can you maybe point me to a solution?

Straight scene test for iOS?

Hi!

Set the settings file as mentioned, edited the bundleId then run a direct build to iOS.

First build gave this :

image from ios

Then edited WindowRect variable from the first scene (which do not even match on mac book display...)
Made another Build & Replace then getting new error :
screen shot 2018-09-02 at 23 53 56

... which now always show up even with a Build & Replace to get a fresh project from scratch...

Any idea? ...
That would be super kind!! ^_^
Thank you so much :)

Chunked download and upload file's content

There should be a way to allow users to stream the file's data (both up and down) to the drive independently of the metadata API calls, so it'll be possible to use any type of caching or sequential reading to preserve memory usage.

CreateRequest bug

Creating a file with "GoogleDriveFiles.CreateRequest" creates a file with 2 additional bytes compared to "GoogleDriveFiles.ResumableCreateRequest"

I suspect the issue is with CreateRequest as updating the file with both UpdateRequest and ResumableUpdateRequest yield the same hash after upload as the ResumableCreateRequest.

As a side note, I would be happy to use the ResumableCreateRequest, but the response data when creation is finished is only a string and I need to get the webContentLink (which can be fetched with CreateRequest), the ResponseData field is a string only which contains information on how to resume the upload

Changes

I apologize if this already exists but I am unable to find it. I am using UnityGoogleDrive to sync the files from an entire folder in google drive to the documents folder of a pixel art app and vice versa, and it mostly works perfectly.

The only flaw is I need to be able to see when the user deletes a file from google drive so I can delete it from the local documents folder.

Looking at the API, I believe I need to use the changes call with the date of the previous call to get this information correctly, but I don't see anything related to this in UnityGoogleDrive. Is there any chance you could add it?

Proofreading

I'm not a native English speaker and could've done some mistakes in the readme, code summary and UI text (especially in the settings editor). Any corrections either via comments here or direct pull requests are greatly appreciated ;)

I need some help

Hello

       I'm almost ready to publish my first game on Play Store but I'm having a lot of problems with Play Services.

I didn't figured it out how to use "Save Games" with GPS,all I need is to save an int number or two,so I'm here and I still can't figure it out.

 I use a custom Player Prefs asset for saving but unfortunately it gets deleted after uninstalling the game.So i tried saving the numbers in a binay file,it worked but it's not as good and simple as PlayerPrefs.

 It's been couple of days and I just can't figure it out.I simply don't understand the codes that are about files.

 Today,I got and idea how could that be done.So if I could let's say in a script on Awake to declare a variable,create a file with the int number in it,upload it on Drive.

Example:

  int Score;

void Awake()

{ /LOAD/
->Download from Drive; ///If the player is an old player
->Use the int number accordingly;
/SAVE/

  Score=PlayerPrefs.GetInt.... ;
  ->creating a file with Score;
  ->upload it on Drive;
  ->delete the file on the drive or change it to null;

}
I use PlayerPrefs in the script because every code that saves or loads is using PlayerPrefs so it is easier to simply use it and not rewrite the scripts.

I would be grateful to get some help.Thanks.

Resumable uploads malformed body

Same as for the multipart issue we had a few days ago now they went on to screw things with resumable uploads. just wanted to let you know

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.