web-dev-qa-db-ja.com

androidで読み取りおよび書き込み用にfirebaseストレージをパブリックにする

Firebase Storageを初めて使用します。誰もが読み書きのためにストレージファイルを公開する方法を教えてもらえますか? firebaseが提供するデフォルトコードは以下のとおりです。どのような変更を加える必要がありますか?

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}
12
ashay

documentation は、ルール式が提供されていない場合、ルールがtrueと評価されることを説明しています。

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
      // Allow access by all users
      allow read, write;
    }
  }
}
22
Bob Snyder

参考:読み取り専用で公開する場合。

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
        allow read;
        allow write: if request.auth != null;
    }
  }
} 
37
Ego Slayer

削除するだけ

request.auth!= null;

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
      // Allow access by all users
      allow read, write;
    }
  }
}

ハッピーコーディング

1
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
} 
1
saigopi
// 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 GAE public.
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}
0

認証条件の削除は機能するはずです。

0
Saikat halder