如何在 Firestore 上正确设置规则以获取信息以在 Ionic 4 上发送电子邮件?

How to set properly rules on Firestore to get information to send an email on Ionic 4?

我有在 Firestore 上读取和写入文档的规则,我设置了一个规则让你 "get" 如果布尔值是真的,但问题是它不起作用...... [的消息=14=] 在我使用 "emailComposer" 时出现,我应该怎么办?非常感谢

service cloud.firestore {
  match /databases/{database}/documents {
        match /objects/{object} {
        allow read, write;
        allow get: if iWantToGetDataToSendAnEmail == true;
    }
  }
}

据我所知,"get" 不是 firebase 的规则。相反,您想使用 "read" 来限制读取访问权限,如下所示:

service cloud.firestore {
  match /databases/{database}/documents {
    match /objects/{object} {
    allow write;
    allow read: if iWantToGetDataToSendAnEmail == true;
    }
  }
}