Thaina / google-signin-unity

Google Sign-In API plugin for Unity game engine. Works with Android and iOS.
Other
41 stars 2 forks source link

GoogleSignInImpl.GoogleSignIn_GetUserId #18

Open harunayyildizhadi opened 2 months ago

harunayyildizhadi commented 2 months ago

Non-fatal Exception: java.lang.Exception: CustomException : First exception in session. Log: FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. | Stacktrace: System.Convert.FromBase64CharPtr (System.Char* inputPtr, System.Int32 inputLength) (at <00000000000000000000000000000000>:0) Google.Impl.GoogleSignInImpl.GoogleSignIn_GetUserId (System.Runtime.InteropServices.HandleRef self) (at <00000000000000000000000000000000>:0) Google.Impl.NativeFuture.get_Result () (at <00000000000000000000000000000000>:0) Google.Future1+d8[T].MoveNext () (at <00000000000000000000000000000000>:0) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0) Google.Impl.GoogleSignInImpl:GoogleSignIn_GetUserId(HandleRef) Google.Impl.NativeFuture:get_Result() Google.d8:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

   at UnityEngine.Application.CallLogCallback(UnityEngine.Application)
   at Google.Impl.GoogleSignInImpl.GoogleSignIn_GetUserId(Google.Impl.GoogleSignInImpl)
   at Google.Impl.NativeFuture.get_Result(Google.Impl.NativeFuture)
   at Google.Future`1+<WaitForResult>d__8[T].MoveNext(Google.Future`1+<WaitForResult>d__8[T])
   at UnityEngine.SetupCoroutine.InvokeMoveNext(UnityEngine.SetupCoroutine)`
harunayyildizhadi commented 1 month ago
// Replace URL-safe characters and fix padding
idTokenPart = idTokenPart.Replace('-', '+').Replace('_', '/');
string fill = new string('=',(4 - (idTokenPart.Length % 4)) % 4);

This change might fix it.

Thaina commented 1 month ago

@harunayyildizhadi Would you like to made pull request?

harunayyildizhadi commented 1 month ago

I didn't have time to test it yet when I've time I'll. Just wanted to post so if anyone wants to test it before I've time for it