firebase:: App
#include <app.h>
Firebase application object.
Summary
firebase::App acts as a conduit for communication between all Firebase services used by an application.
For example:
#if defined(__ANDROID__) firebase::App::Create(firebase::AppOptions(), jni_env, activity); #else firebase::App::Create(firebase::AppOptions()); #endif // defined(__ANDROID__)
Constructors and Destructors |
|
---|---|
~App()
|
Public functions |
|
---|---|
GetJNIEnv() const
|
JNIEnv *
Get JNI environment, needed for performing JNI calls, set on creation.
|
activity() const
|
jobject
Get a global reference to the Android activity provided to the App on creation.
|
java_vm() const
|
JavaVM *
Get Java virtual machine, retrieved from the initial JNI environment.
|
name() const
|
const char *
Get the name of this App instance.
|
options() const
|
const AppOptions &
Get options the App was created with.
|
Public static functions |
|
---|---|
Create()
|
App *
Initializes the default firebase::App with default options.
|
Create(JNIEnv *jni_env, jobject activity)
|
App *
Initializes the default firebase::App with default options.
|
Create(const AppOptions & options)
|
App *
Initializes the default firebase::App with the given options.
|
Create(const AppOptions & options, JNIEnv *jni_env, jobject activity)
|
App *
Initializes the default firebase::App with the given options.
|
Create(const AppOptions & options, const char *name)
|
App *
Initializes a firebase::App with the given options that operates on the named app.
|
Create(const AppOptions & options, const char *name, JNIEnv *jni_env, jobject activity)
|
App *
Initializes a firebase::App with the given options that operates on the named app.
|
GetInstance()
|
App *
Get the default App, or nullptr if none has been created.
|
GetInstance(const char *name)
|
App *
Get the App with the given name, or nullptr if none have been created.
|
Public functions
GetJNIEnv
JNIEnv * GetJNIEnv() const
Get JNI environment, needed for performing JNI calls, set on creation.
This is not trivial as the correct environment needs to retrieved per thread. Note:This method is specific to the Android implementation.
Details | |
---|---|
Returns |
JNI environment object.
|
activity
jobject activity() const
Get a global reference to the Android activity provided to the App on creation.
Also serves as the Context needed for Firebase calls. Note:This method is specific to the Android implementation.
Details | |
---|---|
Returns |
Global JNI reference to the Android activity used to create the App. The reference count of the returned object is not increased.
|
java_vm
JavaVM * java_vm() const
Get Java virtual machine, retrieved from the initial JNI environment.
Note:This method is specific to the Android implementation.
Details | |
---|---|
Returns |
JNI Java virtual machine object.
|
name
const char * name() const
Get the name of this App instance.
Details | |
---|---|
Returns |
The name of this App instance. If a name wasn't provided via Create(), this returns kDefaultAppName.
|
options
const AppOptions & options() const
~App
~App()
Public static functions
Create
App * Create()
Initializes the default firebase::App with default options.
Note:This method is specific to non-Android implementations.
Details | |
---|---|
Returns |