public static void CheckAndFixDependencies(Action <FirebaseStatus> status = null) { #if USE_FIREBASE if (instance == null) { status?.Invoke(FirebaseStatus.Faulted); Debug.LogError("[Firebase] NULL"); return; } if (DependencyStatus != DependencyStatus.Available && Status != FirebaseStatus.Checking) { try { Status = FirebaseStatus.Checking; FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { if (task != null) { DependencyStatus = task.Result; if (DependencyStatus == DependencyStatus.Available) { Debug.Log("[Firebase] CheckDependencies: " + DependencyStatus); status?.Invoke(FirebaseStatus.Available); } else { Debug.LogError("[Firebase] CheckDependencies: " + DependencyStatus); UIToast.ShowError(string.Format("Could not resolve all Firebase dependencies: {0}", DependencyStatus)); status?.Invoke(FirebaseStatus.Faulted); } } else { Debug.LogError("[Firebase] CheckDependencies: " + DependencyStatus); status?.Invoke(FirebaseStatus.Faulted); } }); } catch (FirebaseException ex) { Debug.LogError("[Firebase] CheckDependencies: " + ex.Message); status?.Invoke(FirebaseStatus.Faulted); } catch (Exception ex) { Debug.LogError("[Firebase] CheckDependencies: " + ex.Message); status?.Invoke(FirebaseStatus.Faulted); } } else { status?.Invoke(Status); Debug.Log("[Firebase] CheckDependencies again: " + DependencyStatus); } #endif }