Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Separate firebase-enabled and non-firebase builds #143

Open
a-ghorbani opened this issue Dec 21, 2024 · 0 comments
Open

[Build] Separate firebase-enabled and non-firebase builds #143

a-ghorbani opened this issue Dec 21, 2024 · 0 comments

Comments

@a-ghorbani
Copy link
Owner

Issue description
Currently the app only needs Firebase (App Check) for one specific feature: sharing benchmark results with the community. We use App Check to verify the legitimacy of these benchmark submissions (i.e., to ensure they come from real users rather than automated scripts, etc). For custom compiles or other platforms like fdroid we can disable sharing benchmarks, so Firebase is unnecessary.

Therefore, we want to provide two distinct build variants/flavors:

  • Firebase-Enabled – Includes Firebase libraries (App Check, etc.) and allows sharing benchmark results.
  • Non-Firebase – Excludes all Firebase references and cannot share benchmark results (or just greys out that feature).

Potential solution:

Android

  • Define product flavors in android/app/build.gradle:
    flavorDimensions "default"
    productFlavors {
      firebaseEnabled {
        dimension "default"
        // This flavor includes Firebase dependencies (App Check) 
        // for sharing benchmark results and verifying legitimacy
      }
      firebaseDisabled {
        dimension "default"
        // This flavor has no Firebase libraries -> cannot share benchmarks
      }
    }
  • In the firebaseEnabled flavor:
    • Add google-services.json and apply the Google Services plugin.
  • In the firebaseDisabled flavor:
    • Omit google-services.json.
    • Do not include the Firebase dependencies.

iOS

  • we can create two targets / schemes in Xcode:
    • FirebaseEnabled target references GoogleService-Info.plist.
    • FirebaseDisabled target does not include any Firebase refs.
  • conditionally exclude / include Firebase in Podfile depending on build configs.

ts code

  • Optionally separate or conditionally import the @react-native-firebase modules (e.g., app, app-check)
  • Or rely on autolinking + native flavor settings
@a-ghorbani a-ghorbani added the question Further information is requested label Dec 21, 2024
@a-ghorbani a-ghorbani changed the title Separate Firebase-Enabled and Non-Firebase Builds Separate firebase-enabled and non-firebase builds Dec 21, 2024
@a-ghorbani a-ghorbani changed the title Separate firebase-enabled and non-firebase builds [Build] Separate firebase-enabled and non-firebase builds Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant