Unity + Firebase Storage for iOS giving authorization Exception

Viewed 70

I am using Firebase with Unity for Authentication and Storage. After authenticating the user on iOS, I am unable to download a file from Firebase Storage. When I run the same app for android, I am not getting this error (without making any alterations to the code). This is the following error:

Autoconnected Player Firebase.Storage.StorageException: User is not authorized to perform the desired action at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <00000000000000000000000000000000>:0 at CloudServices.FirebaseDownloadManager+d__10.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].Run () [0x00000] in <00000000000000000000000000000000>:0 at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__7_0 (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.SendOrPostCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <00000000000000000000000000000000>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) [0x00000] in <00000000000000000000000000000000>:0 at SceneController+d__9.SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) [0x00000] in <00000000000000000000000000000000>:0 at Menu.ModelsManager+d__36.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask1[TStateMachine].Run () [0x00000] in <00000000000000000000000000000000>:0 at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.AwaiterActions.Continuation (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1[TResult].TrySetException (System.Exception error) [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].SetException (System.Exception exception) [0x00000] in <00000000000000000000000000000000>:0 at SceneController+d__9.SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) [0x00000] in <00000000000000000000000000000000>:0 at CloudServices.FirebaseDownloadManager+d__10.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2[TStateMachine,T].Run () [0x00000] in <00000000000000000000000000000000>:0 at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__7_0 (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.SendOrPostCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <00000000000000000000000000000000>:0

This is my bucket policy:

rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if request.auth != null; } } }

1 Answers

I got the same issue. It's fine when use FirebaseStorage on android, but auth is fail when run on iOS.

Related