Unity + Firebase Storage for iOS 提供授权例外



我正在使用 Firebase 和 Unity 进行身份验证和存储。在 iOS 上对用户进行身份验证后,我无法从 Firebase 存储下载文件。当我为 android 运行相同的应用程序时,我没有收到此错误(没有对代码进行任何更改)。这是以下错误:

自动连接的玩家 Firebase.Storage.Storage异常:用户无权执行所需的操作 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <0000000000000000000000000000000000000000>00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <00000000000000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000 at CloudServices.FirebaseDownloadManager+d__10.MoveNext () [0x00000] in <000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 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 <00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000 at SceneController+d__9.SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000>00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at Menu.ModelsManager+d__36.MoveNext () [0x00000] in <00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 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 in <00000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1[TResult].TrySetException (System.Exception error) [0x00000] in <00000000000000000000000000000000>:0 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].0x00000<000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000 at SceneController+d__9.SetStateMachine (System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000>00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at CloudServices.FirebaseDownloadManager+d__10.MoveNext () [0x00000] in <000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask'2[TStateMachine,T].0x00000在 <0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>0000000 at System.Action.Invoke () [0x00000] in <000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>00000000000000 at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__7_0 (System.Object state) [0x00000] in <000000000000000000000000000000000000000000000000000000000000000000000000>00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at System.Threading.SendOrPostCallback.Invoke (System.Object state) [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>00000000000000000000000000000000000000000000000000000000 at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in <00000000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <0000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <</p> 00000000000000000000000000000000000000000000000000000000000000000000000000000000000>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

这是我的存储桶策略:

rules_version = '2'; service firebase.storage { match/b/{bucket}/o { match/{allPaths=**} { 允许读取、写入:如果请求.auth != 空; } } }

我遇到了同样的问题。在Android上使用FirebaseStorage时很好,但是在iOS上运行时身份验证会失败。

最新更新