Link Apps With Firebase

  1. Add User Android App in Firebase.
  2. Add iOS User App in Firebase.
  3. [NEW] Enable SafetyNET API & Play Integrity API (if your app requires user Phone number verification)
  4. [NEW] 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. [NEW] 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 (Test Environment): First we will add the below security code to setup the App
    Go to Firebase Dashboard > Firestore Dastabase > Rules. Replace those default rules with below code:
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read,write: if true;
    }
  }
}

9. SETUP FIRESTORE SECURITY RULES (Production Environment) : When you complete the Installation and setting up the User & Admin Apps, Before launch set the security rules to the below code:
Go to Firebase Dashboard > Firestore Dastabase > Rules. Replace those test rules with below code:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read,write: if request.auth.uid != null;
    }
    
    match /license/{licenseId} {
      allow read, write: if true;
    }
     match /userapp/liveconfigs {
      allow read: if true;
      allow write: if request.auth.uid != null;
      allow update: if request.auth.uid != null;
    } 
  
    
    match /agents/{agent} {

 allow read, write: if request.auth.uid != null;
 
}
  
  }
}

10. SETUP FIRESTORE INDEXES :
Go to Firebase Dashboard > Indexes > Composite. Set the indexes the exactly same as shown below.

11. 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 true;
    }
  }
}

Powered by BetterDocs