4

Ich versuche, Bilder aus Firebase-Speicher herunterzuladen, aber ich bekomme Fehler.Firebase Storage-Authentifizierung Probleme

E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.android.gms.internal.zzanu: Please sign in before trying to get a token. 
W/NetworkRequest: no auth token for request 

Allerdings habe ich meine Regeln wie folgt aufgebaut:

service firebase.storage { 
    match /b/<myappnameredacted>.appspot.com/o { 
     match /{allPaths=**} { 
      allow read, write; 
     } 
    } 
} 

Antwort

0

Ihre Regeln sind nicht wie in der Firebase Storage Security Rules Documentation.

Für öffentliche alle Ihre Dateien machen (für jedermann), zu verwenden:

// Anyone can read or write to the bucket, even non-users of your app. 
// Because it is shared with Google App Engine, this will also make 
// files uploaded via Google App Engine public. 

service firebase.storage { 
    match /b/{bucket}/o { 
    match /{allPaths=**} { 
     allow read, write; 
    } 
    } 
} 

Für alle Ihre Dateien lesbar (für jedermann) herzustellen, zu verwenden:

service firebase.storage { 
    match /b/{bucket}/o { 
    match /{allPaths=**} { 
     allow read; 
    } 
    } 
} 

Sie können auch machen nur Ihre Bild lesbar/beschreibbar, siehe Firebase Storage Security Rules Documentation.