-
firebase のコンソール画面でプロジェクトを追加する。プロジェクト名などは任意のものでいい。
-
Android アプリを追加する
-
Android パッケージ名を"com.example.place"としてアプリを登録
-
googlr-service.json をダウンロードして指示通りの位置に配置する
-
Firebase SDK はバージョンが異なる場合はバージョンを Android アプリの方で合わせておく
-
あとは指示通りにコンソールに進む
- アプリのデータ保存に必要
-
コンソールから Firestore の設定画面に行きデータベースの作成をする
-
モードはとりあえずテストモードでいい
-
ロケーションは自由で良し
-
設定完了するとこの画面に行きつく(いかなければ reload とかする)
-
ルールのところで"ルール json"のようにルールを設定する
ルール json
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /users/{userId} { allow read, create: if request.auth != null; match /data/{dataId}{ allow read, create: if request.auth.uid == userId; } } match /vocabulary/{userId} { allow read: if request.auth != null; match /data/{dataId}{ allow read: if request.auth.uid == userId; } } match /androidResults/{userId} { allow read, write: if request.auth != null; match /MeasurementType/{MeasurementId}{ allow read, write: if request.auth.uid == userId; match /Data/{DataId}{ allow read, create: if true; } } match /data/{dataId}{ allow read, create: if true; } } match /androidResults_MT/{userId} { allow read, write: if request.auth != null; match /MeasurementType/{MeasurementId}{ allow read, write: if request.auth.uid == userId; match /Data/{DataId}{ allow read, create: if true; } } match /data/{dataId}{ allow read, create: if true; } } match /engTest/{documentId}{ allow read, create: if true; match /data/{dataId}{ allow read, create: if true; } } match /engTest_MT/{documentId}{ allow read, create: if true; match /data/{dataId}{ allow read, create: if true; } } match /engWriteTest/{userId}{ allow read, create: if true; match /data/{dataId}{ allow read, create: if true; } } } }
- ログインのために必要












