👏

firebaseにテキストを送るとき、エラーが出て反映されない

2024/03/30に公開

flutter大学さんの教科書に沿ってコードを書いてる時以下のようなエラーが出ました。

firebaseexception ([cloud_firestore/permission-denied] the caller does not have permission to execute the specified operation.)

データベースへのアクセスが許可されていない。とのことなので、調べてみるとfirebaseのルールを変更すると、全許可と全拒否と認証すれば許可に設定できるそうです。
リンク:https://firebase.google.com/docs/firestore/security/get-started?hl=ja#auth-required

以下の画像のように変更し、無事データベースへの更新ができました。

Discussion