Link Apps with Firebase

  1. Add User Android App in Firebase.
  2. Add iOS User App in Firebase.
  3. Enable Google Play Integrity API
  4. 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.
  5. 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)
  6. 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).
  7. Setup Push Notifications
  8. 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;
    }
  }
}

Powered by BetterDocs