📄
Sunbird Saral
  • Sunbird Saral Overview
  • Saral Quick Guide
  • Saral Implementation Manual
    • OMR led scanning - Assessments
    • OCR led scanning - Admissions
  • Saral Transformation Story
  • LEARN
    • Software Requirement
    • Application Architecture
    • Features
      • Configurable Branding
      • Capture AI/ML Training Data
      • Support
      • Share App data
      • Auto Sync
      • Multi-Page support
      • Profile Menu
      • Dynamic Validations
      • Dynamic Tagging
      • Minimal Mode
      • Offline mode
      • App Force Update
      • Review results/marks
      • Firebase Analytics and Crashlytics
      • ML model deployment using Firebase
      • Improved Low light Performance - Manual Edit
      • Vertical Forms Scanning Support
      • Improve Processing Speed for big layouts
      • Admissions Data Capture
      • Securing PII Data Capture - Admissions
    • Specifications
      • Layout specification
      • Backend API Swagger Doc
    • Videos
      • Feature Explanation
        • OMR Layout scanning
        • Auto-Sync
        • Share scan app data
        • Skip feature
        • Support feature
        • Validation feature
        • Incorrect scanning
        • Multi-page feature
        • Branding feature
        • Offline mode
        • Review results/marks
      • Usage by States
        • Gujarat Implementation - Between 39:00 - 40:00 mins
        • Uttar Pradesh(U.P) , Gorakhpur Implementation
    • ML Model Accuracy/Results
  • USE
    • Roadmap
    • Workspace Setup - Playbook
    • Saral App Reference Backend
    • Generating APK from source code
    • Generate AAB(App bundle) from source code
    • Sign already generated APK file with private Key
    • Layout configuration
    • Debug/Run Saral App from Android Studio
    • Saral App Debug Tips
    • Saral App Usage Guidelines
    • Update BASE_URL,apkURL in APK
    • Update BASE_URL,apkURL in AAB
    • Sign already generated AAB(Android App Bundle) file with private key
    • Google Play Store App Publish Considerations
    • Layout Design Guidelines
    • Saral OCR Assets
    • Firebase setup for Saral App Telemetry
    • Firebase setup for TFLite model deployment
    • Alternatives for Saral components
  • ENGAGE
    • Source Code Repository
    • Saral SDK Source Code Repository
    • Tracker
    • Releases
      • v1.0.0-beta.1
      • v1.0.0-beta.2
      • v1.0.0-beta.3
      • v1.0.0-beta.4
      • v1.0.0-beta5
      • v1.5.0
      • v1.5.1
      • v1.5.2
      • v1.5.3
      • v1.5.4
      • v1.5.5
      • v1.5.6
      • v1.5.7
      • v1.5.9
      • v1.6.0
      • v1.6.1
      • v1.6.2
      • v1.7.0
    • Saral - Solution Providers
    • Discuss
  • Experience Saral
  • Dev Environment - Installation & Maintenance
    • Saral Installation Guide (Non-Prod)
    • Saral - Sandbox Maintenance Guide (Non-Prod)
  • Saral Easy Installer
    • Saral Production-Environment User Installation Guide
      • Manual Installation for Prod
      • Automating the Infra provisioning and install of the Saral application
        • Prerequisites
        • What automation does
        • Run installer
        • Post install steps
        • Monitoring-Stack
    • Reference Documents
      • SARAL Infra Requirements & Associated Cost
      • Saral Infra Cost Benefit Analysis
  • Tool for Saral Easy Layout generation and Auto generate ROI json
Powered by GitBook
On this page
  • Setup react native side
  • Add In your module (app-level) Gradle file under dependencies
  • On the top of (app-level) Gradle file add this line
  • Add In your root-level (project-level) Gradle file under dependencies
  • Add In your frontend/SaralApp/android/app/src/main/AndroidManifest.xml
  • To link the app to firebase, go to the firebae console and make project
  • To link the app after the project is created
  • Firebase Analytics Run time configuration
  • Firebase Pricing plans

Was this helpful?

Edit on GitHub
  1. USE

Firebase setup for Saral App Telemetry

Firebase setup for Saral App Telemetry

Setup react native side

Some libraries have to be installed to add firebase Google Analytics and firebase Google Crashlytics in react native

npm i @react-native-firebase/app
npm i @react-native-firebase/analytics
npm i @react-native-firebase/crashlytics

Add In your module (app-level) Gradle file under dependencies

implementation "com.google.firebase:firebase-iid:21.1.0"
implementation "com.google.firebase:firebase-bom:31.2.2"
implementation 'com.google.firebase:firebase-analytics'
implementation ('com.google.firebase:firebase-iid:21.1.0'){
transitive = true}

On the top of (app-level) Gradle file add this line

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.analytics'
apply plugin: 'com.google.firebase.crashlytics'

Add In your root-level (project-level) Gradle file under dependencies

classpath("com.google.gms:google-services:4.3.3")
classpath "com.google.firebase:firebase-iid:19.0.0"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'

Add In your frontend/SaralApp/android/app/src/main/AndroidManifest.xml

< meta-data android:name="firebase_analytics_collection_enabled" android:value="true" />

< meta-data android:name="firebase_crashlytics_collection_enabled" android:value="true" />

To link the app to firebase, go to the firebae console and make project

To link the app after the project is created

Add google-service.json under android/app

Firebase Analytics Run time configuration

For enable or disable at run time environment firebase_analytics_collection_enabled in App.js file frontend/SaralApp/App.js

You need to add flag isFBAnalyticsEnabled in login api

/schools/login

Response from api

"school": { "storeTrainingData": true, "name": "Dummy school 4", "schoolId": "u002", "state": "up", "district": "district1", "autoSync": true, "autoSyncFrequency": 900000, "tags": true, "autoSyncBatchSize": 10, "offlineMode": true, "isAppForceUpdateEnabled": false, "isFBAnalyticsEnabled": true, "userId": "u002" }

Add in code useEffect(async()=>{ let hasFBAnalytics = await getLoginData();

const hasFBAnalyticsValue = hasFBAnalytics.school && hasFBAnalytics.school.enableFBAnalytics
if(hasFBAnalyticsValue != null){
if (__DEV__) {
  analytics().setAnalyticsCollectionEnabled(hasFBAnalyticsValue);
  crashlytics().setCrashlyticsCollectionEnabled(hasFBAnalyticsValue);}  else{
  analytics().setAnalyticsCollectionEnabled(hasFBAnalyticsValue);
  crashlytics().setCrashlyticsCollectionEnabled(hasFBAnalyticsValue);}}},[])

DEV variable. By default if you run your app with npx react-native run-android, it will run in Debug mode and DEV will be true. In release mode, DEV will be false. Here hasFBAnalyticsValue is the flag which will come from backend as boolean. If mobile is not connected with internet then data will not pushed to the firebase

After adding all dependencie rebuild the app using npx react-native run-android

Firebase Pricing plans

PreviousLayout Design GuidelinesNextFirebase setup for TFLite model deployment

Last updated 1 year ago

Was this helpful?

Get started at no cost,then pay as you go. Firebase service will be free of cost for some time but after some time events triggered it will be chargeable Here is the link for know all plans

firebase console
pricing plans