A JSON string that contains Firebase configuration i.e. the content of the downloaded google-services.json file.
options
Optional: If provided, load options into it.
Returns
An instance containing the loaded options if successful. If the options argument to this function is null, this method returns an AppOptions instance allocated from the heap.
[[["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::AppOptions Class Reference\n\nfirebase::AppOptions\n====================\n\n\n`#include \u003capp.h\u003e`\n\nOptions that control the creation of a Firebase [App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app).\n\nSummary\n-------\n\n\n**See also:**\n[firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app)\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AppOptions](#classfirebase_1_1_app_options_1a5e50b35c610e27f7f2b4f0318055dd47)`()` Create [AppOptions](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options). ||\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [api_key](#classfirebase_1_1_app_options_1af27ddadf6ddfe379fb821d0fd7954d22)`() const ` | `const char *` Get the API key. |\n| [app_id](#classfirebase_1_1_app_options_1a16d96ca57e90a5bc30a0a6fb94f79459)`() const ` | `const char *` Retrieves the app ID. |\n| [database_url](#classfirebase_1_1_app_options_1ad0261ff25346f8a4d82da2915ec58646)`() const ` | `const char *` Get database root URL, e.g. |\n| [messaging_sender_id](#classfirebase_1_1_app_options_1a0248e9f0fdb164d3d33383c0f4756183)`() const ` | `const char *` Get the Firebase Cloud Messaging sender ID. |\n| [project_id](#classfirebase_1_1_app_options_1a5831a8c77eec92e30813f16a7655b853)`() const ` | `const char *` Get the Google Cloud project ID. |\n| [set_api_key](#classfirebase_1_1_app_options_1ac8ed231504a8c11838ed53f9b2ebf253)`(const char *key)` | `void` API key used to authenticate requests from your app. |\n| [set_app_id](#classfirebase_1_1_app_options_1a67573953fe43ce9b8cff6b0602409140)`(const char *id)` | `void` Set the Firebase app ID used to uniquely identify an instance of an app. |\n| [set_database_url](#classfirebase_1_1_app_options_1a171ef782c65c4deb5d8a109f985cef09)`(const char *url)` | `void` Set the database root URL, e.g. \"\u003chttp://abc-xyz-123.firebaseio.com\u003e\". |\n| [set_messaging_sender_id](#classfirebase_1_1_app_options_1a6f0824a31d908b059316af8b3c595506)`(const char *sender_id)` | `void` Set the Firebase Cloud Messaging sender ID. |\n| [set_project_id](#classfirebase_1_1_app_options_1af2f9f576035e5eb289817cf2c0dd525c)`(const char *project)` | `void` Set the Google Cloud project ID. |\n| [set_storage_bucket](#classfirebase_1_1_app_options_1a9c651c380ee603d7028c5c03ee5c5307)`(const char *bucket)` | `void` Set the Google Cloud Storage bucket name, e.g. |\n| [storage_bucket](#classfirebase_1_1_app_options_1a41bdfb8021440feac759d944ea6f5d34)`() const ` | `const char *` Get the Google Cloud Storage bucket name,. |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| [LoadFromJsonConfig](#classfirebase_1_1_app_options_1a54f8d0909118ba7937362f36a259d91c)`(const char *config, `[AppOptions](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options)` *options)` | [AppOptions](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options)` *` Load options from a config string. |\n\nPublic functions\n----------------\n\n### AppOptions\n\n```c++\n AppOptions()\n``` \nCreate [AppOptions](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options).\n\nTo create a [firebase::App](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) object, the Firebase application identifier and API key should be set using [set_app_id()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1a67573953fe43ce9b8cff6b0602409140) and [set_api_key()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1ac8ed231504a8c11838ed53f9b2ebf253) respectively.\n\n**See also:** [firebase::App::Create()](/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app_1a5161747a9bbed350214cb5e1c0a23503). \n\n### api_key\n\n```c++\nconst char * api_key() const \n``` \nGet the API key.\n\n**See also:** [set_api_key()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1ac8ed231504a8c11838ed53f9b2ebf253). \n\n### app_id\n\n```c++\nconst char * app_id() const \n``` \nRetrieves the app ID.\n\n**See also:** [set_app_id()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1a67573953fe43ce9b8cff6b0602409140). \n\n### database_url\n\n```c++\nconst char * database_url() const \n``` \nGet database root URL, e.g.\n\n\"\u003chttp://abc-xyz-123.firebaseio.com\u003e\". \n\n### messaging_sender_id\n\n```c++\nconst char * messaging_sender_id() const \n``` \nGet the Firebase Cloud Messaging sender ID.\n\n**See also:** [set_messaging_sender_id()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1a6f0824a31d908b059316af8b3c595506). \n\n### project_id\n\n```c++\nconst char * project_id() const \n``` \nGet the Google Cloud project ID.\n\nThis is the project_id in the Android google-services.json config file or PROJECT_ID in the GoogleService-Info.plist. \n\n### set_api_key\n\n```c++\nvoid set_api_key(\n const char *key\n)\n``` \nAPI key used to authenticate requests from your app.\n\nFor example, \"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk\" used to identify your app to Google servers.\n\nThis only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources. \n\n### set_app_id\n\n```c++\nvoid set_app_id(\n const char *id\n)\n``` \nSet the Firebase app ID used to uniquely identify an instance of an app.\n\nThis is the mobilesdk_app_id in the Android google-services.json config file or GOOGLE_APP_ID in the GoogleService-Info.plist.\n\nThis only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources. \n\n### set_database_url\n\n```c++\nvoid set_database_url(\n const char *url\n)\n``` \nSet the database root URL, e.g. \"\u003chttp://abc-xyz-123.firebaseio.com\u003e\". \n\n### set_messaging_sender_id\n\n```c++\nvoid set_messaging_sender_id(\n const char *sender_id\n)\n``` \nSet the Firebase Cloud Messaging sender ID.\n\nFor example \"012345678901\", used to configure Firebase Cloud Messaging.\n\nThis only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources. \n\n### set_project_id\n\n```c++\nvoid set_project_id(\n const char *project\n)\n``` \nSet the Google Cloud project ID. \n\n### set_storage_bucket\n\n```c++\nvoid set_storage_bucket(\n const char *bucket\n)\n``` \nSet the Google Cloud Storage bucket name, e.g.\n\n\\\\\"abc-xyz-123.storage.firebase.com\\\\\". \n\n### storage_bucket\n\n```c++\nconst char * storage_bucket() const \n``` \nGet the Google Cloud Storage bucket name,.\n\n**See also:** [set_storage_bucket()](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options_1a9c651c380ee603d7028c5c03ee5c5307).\n\nPublic static functions\n-----------------------\n\n### LoadFromJsonConfig\n\n```c++\nAppOptions * LoadFromJsonConfig(\n const char *config,\n AppOptions *options\n)\n``` \nLoad options from a config string.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------|------------------------------------------------------------------------------------------------------------------| | `config` | A JSON string that contains Firebase configuration i.e. the content of the downloaded google-services.json file. | | `options` | Optional: If provided, load options into it. | |\n| **Returns** | An instance containing the loaded options if successful. If the options argument to this function is null, this method returns an [AppOptions](/docs/reference/cpp/class/firebase/app-options#classfirebase_1_1_app_options) instance allocated from the heap. |"]]