[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-23 UTC."],[],[],null,["firebase::App\n\n\n`#include \u003capp.h\u003e`\n\nFirebase application object.\n\nSummary\n\n[firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) acts as a conduit for communication between all Firebase services used by an application.\n\nFor example: \n\n```c++\n#if defined(__ANDROID__)\nfirebase::App::Create(firebase::AppOptions(), jni_env, activity);\n#else\nfirebase::App::Create(firebase::AppOptions());\n#endif // defined(__ANDROID__)\n```\n\n\u003cbr /\u003e\n\nPublic functions \n\nGetJNIEnv \n\n```c++\nJNIEnv * GetJNIEnv() const \n``` \nGet JNI environment, needed for performing JNI calls, set on creation.\n\nThis is not trivial as the correct environment needs to retrieved per thread.\n| **Note:** This method is specific to the Android implementation.\n\n\u003cbr /\u003e\n\nactivity \n\n```c++\njobject activity() const \n``` \nGet a global reference to the Android activity provided to the [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) on creation.\n\nAlso serves as the Context needed for Firebase calls.\n| **Note:** This method is specific to the Android implementation.\n\n\u003cbr /\u003e\n\njava_vm \n\n```c++\nJavaVM * java_vm() const \n``` \nGet Java virtual machine, retrieved from the initial JNI environment.\n\n\n| **Note:** This method is specific to the Android implementation.\n\n\u003cbr /\u003e\n\nname \n\n```c++\nconst char * name() const \n``` \nGet the name of this [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) instance.\n\n\u003cbr /\u003e\n\noptions \n\n```c++\nconst AppOptions & options() const \n``` \nGet options the [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) was created with.\n\n\u003cbr /\u003e\n\n\\~App \n\n```c++\n ~App()\n``` \n\nPublic static functions \n\nCreate \n\n```c++\nApp * Create()\n``` \nInitializes the default [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with default options.\n\n\n| **Note:** This method is specific to non-Android implementations.\n\n\u003cbr /\u003e\n\nCreate \n\n```c++\nApp * Create(\n JNIEnv *jni_env,\n jobject activity\n)\n``` \nInitializes the default [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with default options.\n\n\n| **Note:** This method is specific to the Android implementation.\n\n\u003cbr /\u003e\n\nCreate \n\n```c++\nApp * Create(\n const AppOptions & options\n)\n``` \nInitializes the default [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with the given options.\n\n\u003cbr /\u003e\n\n| **Note:** This method is specific to non-Android implementations.\nOptions are copied at initialization time, so changes to the object are ignored.\n\n\u003cbr /\u003e\n\nCreate \n\n```c++\nApp * Create(\n const AppOptions & options,\n JNIEnv *jni_env,\n jobject activity\n)\n``` \nInitializes the default [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with the given options.\n\n\u003cbr /\u003e\n\n| **Note:** This method is specific to the Android implementation.\nOptions are copied at initialization time, so changes to the object are ignored.\n\n\u003cbr /\u003e\n\nCreate \n\n```c++\nApp * Create(\n const AppOptions & options,\n const char *name\n)\n``` \nInitializes a [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with the given options that operates on the named app.\n\n\u003cbr /\u003e\n\n| **Note:** This method is specific to non-Android implementations.\nOptions are copied at initialization time, so changes to the object are ignored.\n\n\u003cbr /\u003e\n\nCreate \n\n```c++\nApp * Create(\n const AppOptions & options,\n const char *name,\n JNIEnv *jni_env,\n jobject activity\n)\n``` \nInitializes a [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with the given options that operates on the named app.\n\n\u003cbr /\u003e\n\n| **Note:** This method is specific to the Android implementation.\nOptions are copied at initialization time, so changes to the object are ignored.\n\n\u003cbr /\u003e\n\nGetApps \n\n```c++\nstd::vector\u003c App * \u003e GetApps()\n``` \nGet all the apps, including the default one. \n\nGetInstance \n\n```c++\nApp * GetInstance()\n``` \nGet the default [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app), or nullptr if none has been created. \n\nGetInstance \n\n```c++\nApp * GetInstance(\n const char *name\n)\n``` \nGet the [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) with the given name, or nullptr if none have been created."]]