2017-10-26 20 views
0

Firebase、テストモードでCloud Firestoreを使用してAndroidアプリケーションを開発しました。テストモードは、「自分のデータベース参照を持つ人は誰でも自分のデータベースを読み書きできます」という意味です。次に、セキュリティのルールを「」に変更しました。これを防ぐには、偽の場合は 'を読んで書き込みます。ロックモードと呼ばれます。 しかし、ロックモードでは、データはフェッチされません。これについてはGoogleに適切な文書はありません。私に何ができる?ロックモードでFirebase Firestoreデータを取得する方法

答えて

0

Security Rules documentationを参照してください。これは、Firestoreデータベースを適切に保護する方法を説明します。例:

service cloud.firestore { 
    match /databases/{database}/documents { 
    // only a user can read and write their profile 
    match /users/{userId} { 
     allow read, write: if request.auth.uid == userId; 
    } 
    // any authenticated user can read and write messages 
    match /rooms/{roomId} { 
     match /messages/{messageId} { 
     allow read, write: if request.auth != null; 
     } 
    } 
    } 
} 
関連する問題