midworld / unity-googledrive

Google Drive for Unity3D
Apache License 2.0
121 stars 28 forks source link

iOS Build: invalid_request #35

Open peter-slattery opened 6 years ago

peter-slattery commented 6 years ago

I've gone through the process of getting this repo to build to iOS, and upon successfully launching the app on a device, instantly get a Debug.Log saying "invalid_request" as follows:

GoogleDrive+Exception: invalid_request
<InitGoogleDrive>c__Iterator0:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51

Background: Before this, I had gone through all of WebView.mm and removed all dealloc, release and retain commands. I also found that we needed to modify all webViewPlugin assignments to match below: WebViewPlugin *webViewPlugin = (__bridge WebViewPlugin *)instance;

midworld commented 6 years ago

Hi Peter, It doesn't have the specific line where the exception is occurred. Can you build it with debug option to investigate? Thanks.

peter-slattery commented 6 years ago

We built it in Debug to begin with, but because it's in a Coroutine, the line numbers it provides aren't super helpful. We figured out that its this section in your DriveTest script:

if (authorization.Current is Exception) {
    Debug.LogWarning ((authorization.Current as Exception));
    goto finish;
} else
    Debug.Log ("User Account: " + drive.UserAccount);

The Google+Drive Exception is being raised by the Debug.LogWarning ((authorization.Current as Exception)); command

midworld commented 6 years ago

Hmm, I think Google drive doesn't support OAuth2 anymore.