0

I want to create a standalone instance of Firebase for my JNI-library purposes. E.g. the library should report its own analytics and receive remote configs. And all of that should be done separately from an app, which can have another Firebase object.

I've found the next method in Firebase library for C++:

static ::firebase::App* ::firebase::App:Create(const ::firebase::AppOptions& options, const char* name, JNIEnv* jni_env, jobject activity);

It allows creating 'named' instance of Firebase app. However, I couldn't find the proper methods for creating ::firebase::Analytics and ::firebase::RemoteConfig that will consume my 'named' Firebase app.

So, I have two questions about that:

  1. Is it possible (maybe someone knows any workarounds) to create my instances of analytics and remote config within JNI code?
  2. And the question to Firebase team. Do you plan to implement the mentioned functionality for analytics/remote config? I see that you've allowed the same option for ::firebase::database::Database class and I'm able to instantiate database separately from a main app.

Thanks in advance!

Orange
  • 553
  • 3
  • 20

1 Answers1

0

This is not possible. Analytics, and Firebase products derived from Analytics data (such as Remote Config) only work at the application level. They can't be bundled into a library for use across apps. The products depend heavily on the behavior of the app as a whole, so they can only be configured to work with a single app at a time. This is true for all client libraries, not just C++. There are no plans to change this behavior.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Thanks for the explanation. But what about ::firebase::database::Database? Why did you make it available for 'named' apps? – Orange Aug 13 '18 at 15:00
  • (Note that I didn't design the APIs or their behavior, I can only really tell you how they were intended to be used.) I think you're misunderstanding what you call a "named" app. There is not really such a thing. What you are naming is the FirebaseApp instance that's configured to work with a particular project. The name is intended to uniquely identify multiple FirebaseApp instances that could be used in your app. It would have been more accurate to call it "FirebaseProject", since that's what you're working with. A single app may reach into multiple databases in multiple projects. – Doug Stevenson Aug 13 '18 at 15:05
  • It's makes sense that a single app may want to read multiple databases in multiple projects, but it doesn't make sense for a single app to broadcast its analytics to multiple arbitrary projects, nor does it make sense for multiple arbitrary apps to broadcast their analytics to a single project. – Doug Stevenson Aug 13 '18 at 15:06