使firebase存储公开以便在android上进行读写

ash*_*hay 15 android firebase firebase-security firebase-authentication firebase-realtime-database

我是firebase存储的新手.谁能告诉我如何将存储文件公开用于读写?firebase提供的默认代码如下所示.我应该做些什么改变?

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

Ego*_*yer 37

仅供参考:如果您想要公开阅读.

service firebase.storage {
  match /b/image-view-b1cf5.appspot.com/o {
    match /{allPaths=**} {
        allow read;
        allow write: if request.auth != null;
    }
  }
} 
Run Code Online (Sandbox Code Playgroud)

  • 好一个;无法找到如何设置 d/t 规则以在其文档上进行读写。 (2认同)

Bob*_*der 24

文档说明如果未提供规则表达式,则规则的计算结果为true:

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