- Add User Android App in Firebase.
- Add iOS User App in Firebase.
- Enable Google Play Integrity API
- Go to your Firebase dashboard —> Go to Project Settings —> Cloud Messaging tab —> Enable both Firebase Cloud Messaging API (V1) & Firebase Cloud Messaging API (Legacy) if not enabled already.
- Go to Google Cloud Platform (GCP) —> Go to Console —> Select project from the dropdown —> In the top search bar, search for “Artifact Registry API” —> Enable the API. ( required for uninterrupted delivery of Notifications in the App. Firebase Billing must be enabled to use this API)
- Copy Firebase project ID from the Firebase dashboard > Project Settings page & Paste it inside this file > .firebaserc
Android App will be successfully linked to your Firebase Project (if all the above steps are followed correctly). - Setup Push Notifications
- SETUP FIRESTORE SECURITY RULES :
Go to Firebase Dashboard > Rules. Replace those default rules with below code:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth!=null; allow read, write: if request.auth==null;
}
match /version/userapp {
allow read, write : if request.auth!=null; allow read, write : if request.auth==null;
}
match /users/{userId} {
allow read, write : if request.auth.uid== userId ;
}
}
}
9. SETUP FIRESTORE INDEXES :
Go to Firebase Dashboard > Indexes > Composite. Set the indexes the exactly same as shown below.
10. SETUP STORAGE SECURITY RULES :
Go to Firebase Dashboard > Storage > Rules. Replace those default rules with below code:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
allow read, write: if request.auth == null;
}
}
}