firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.23k stars 565 forks source link

Support multiple firebase app id/project id #2726

Open tobecrazy opened 3 years ago

tobecrazy commented 3 years ago

What feature would you like to see?

We would like firebase initial support multiple app-id/project , For example. We have an project own by location A which use firebase push service which use firebase account A, now we wanna integrate firebase crashlytics and performance, but we must use account B own by location B. So we wanna when collect crash/performance use B , push with A . I did some research , firebase have an API FirebaseOptions which is support initial multiple services account. So could you please implement this for crashlytics ?

https://github.com/firebase/snippets-android/blob/14cfefcaf00f9aae6f613281f46000d15f9047be/firebaseoptions/app/src/main/java/devrel/firebase/google/com/firebaseoptions/MainActivity.java

Describe the feature you would like to add, ideally proposing a specific API.

When we get a instance from https://github.com/firebase/firebase-android-sdk/blob/master/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java @NonNull public static FirebaseCrashlytics getInstance(String name) { final FirebaseApp app = FirebaseApp.getInstance(name); final FirebaseCrashlytics instance = app.get(FirebaseCrashlytics.class); if (instance == null) { throw new NullPointerException("FirebaseCrashlytics component is not present."); } return instance; }

Pls refer to : https://github.com/firebase/firebase-android-sdk/blob/95b36fca16e4a4be231c435759db94ad4d3e8e61/firebase-common/src/main/java/com/google/firebase/FirebaseApp.java#L199

BTW ,depends lib as below

How would you use it?

Suppose for collect crash/performance for our app.

Tell us how you'd use this feature in your app.

google-oss-bot commented 3 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

tobecrazy commented 3 years ago

@aguatno @sheepmaster @jamesdaniels Do we have plan to implement this ?

aguatno commented 3 years ago

Hi @tobecrazy We appreciate you logging this feature request and going to the effort to explain it. I agree that this could be a potentially useful change.

I've logged this feature request so we can track it internally so engineers and product can view it as well, and will leave this open here in the meantime.