• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Meinzelmaenchen · Aug 15, 2014 at 08:36 AM · androidgoogleaccessscopedrive

Google Drive Plugin - full access from android device

Hello,

I'm using the "Google Drive for Unity3D plugin" from the forum. What I want to do is, that the user can upload a file with $$anonymous$$s browser on $$anonymous$$s pc to Google Drive. Then I want to download t$$anonymous$$s file on an android tablet.

I t$$anonymous$$nk that means that the App needs full access to google drive. Therefore I added the scope "https://www.googleapis.com/auth/drive" in "GoogleDriveAuthorization.cs". In the Edtior everyt$$anonymous$$ng works fine and I can download the uploaded files.

But on a real android device it doesn't work. The initialization/authorization works. It's also possible to upload and download a text file w$$anonymous$$ch has been created by the app (like in the sample code). But if I search for the other files, w$$anonymous$$ch have been uploaded with the browser, not$$anonymous$$ng is found.

My assumption is that my app hasn't got full access to Google Drive and beacause of t$$anonymous$$s the files w$$anonymous$$ch haven't been created by the app, can't be found.

What do you t$$anonymous$$nk? How can I solve t$$anonymous$$s?

Comment
opponent019

People who like this

1 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Meinzelmaenchen · Aug 18, 2014 at 10:10 AM

I found a solution. Thanks to "midworld" for the help!

Android doesn't use web browser based method for authorization. You have to modify the plugin itself.

Go to the file "unity-googledrive / NativePlugins / Android / GoogleDrivePlugin / src / com / studio272 / googledriveplugin / GoogleDrivePlugin.java"

Here you can modify the permissions:

 credential = GoogleAccountCredential.usingOAuth2(activity,
 "https://www.googleapis.com/auth/drive.file",
 "https://www.googleapis.com/auth/drive.appdata");

Replace the new "googledriveplugin.jar" in "unity-googledrive / Assets / Plugins / Android" and it should work.

Maybe it helps, if some has the same problem :)

Comment
JustARabbit

People who like this

1 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JustARabbit · Jun 28, 2015 at 01:06 PM 0
Share

I tried what you described above but I am still having trouble getting all my files on Android. With logcat I was able to see that I was authenticated with the correct "https://www.googleapis.com/auth/drive.Drive@" scope, however it doesn't return any files. Any suggestions or help would be much appreciated.

avatar image

Answer by JustARabbit · Jun 30, 2015 at 11:05 AM

Actually t$$anonymous$$s definitely works. My problem was that my query string was too long. It was giving me correct a response without any of the files.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Video system / rendering is stuck on Android OculusGO 0 Answers

OBB downloader missing from asset store? 0 Answers

Exporting Google Android project from Unity 4 to Android Studio issue 0 Answers

Unity3D and Google Cardboard 3Models black lines on screen 2 Answers

Can i give a APK file to a "stranger"? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges