firebase:: AppOptions
#include <app.h>
Options that control the creation of a FirebaseApp.
Summary
See also:firebase::App
Constructors and Destructors | |
|---|---|
AppOptions()CreateAppOptions. |
Public functions | |
|---|---|
api_key() const | const char *Get the API key. |
app_id() const | const char *Retrieves the app ID. |
database_url() const | const char *Get database root URL, e.g. |
messaging_sender_id() const | const char *Get the Firebase Cloud Messaging sender ID. |
project_id() const | const char *Get the Google Cloud project ID. |
set_api_key(const char *key) | voidAPI key used to authenticate requests from your app. |
set_app_id(const char *id) | voidSet the Firebase app ID used to uniquely identify an instance of an app. |
set_database_url(const char *url) | voidSet the database root URL, e.g. "http://abc-xyz-123.firebaseio.com". |
set_messaging_sender_id(const char *sender_id) | voidSet the Firebase Cloud Messaging sender ID. |
set_project_id(const char *project) | voidSet the Google Cloud project ID. |
set_storage_bucket(const char *bucket) | voidSet the Google Cloud Storage bucket name, e.g. |
storage_bucket() const | const char *Get the Google Cloud Storage bucket name,. |
Public static functions | |
|---|---|
LoadFromJsonConfig(const char *config,AppOptions *options) | Load options from a config string. |
Public functions
AppOptions
AppOptions()
CreateAppOptions.
To create afirebase::App object, the Firebase application identifier and API key should be set usingset_app_id() andset_api_key() respectively.
See also:firebase::App::Create().
database_url
constchar*database_url()const
Get database root URL, e.g.
messaging_sender_id
constchar*messaging_sender_id()const
Get the Firebase Cloud Messaging sender ID.
See also:set_messaging_sender_id().
project_id
constchar*project_id()const
Get the Google Cloud project ID.
This is the project_id in the Android google-services.json config file or PROJECT_ID in the GoogleService-Info.plist.
set_api_key
voidset_api_key(constchar*key)
API key used to authenticate requests from your app.
For example, "AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk" used to identify your app to Google servers.
This only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources.
set_app_id
voidset_app_id(constchar*id)
Set the Firebase app ID used to uniquely identify an instance of an app.
This is the mobilesdk_app_id in the Android google-services.json config file or GOOGLE_APP_ID in the GoogleService-Info.plist.
This only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources.
set_database_url
voidset_database_url(constchar*url)
Set the database root URL, e.g. "http://abc-xyz-123.firebaseio.com".
set_messaging_sender_id
voidset_messaging_sender_id(constchar*sender_id)
Set the Firebase Cloud Messaging sender ID.
For example "012345678901", used to configure Firebase Cloud Messaging.
This only needs to be specified if your application does not include google-services.json or GoogleService-Info.plist in its resources.
set_project_id
voidset_project_id(constchar*project)
Set the Google Cloud project ID.
set_storage_bucket
voidset_storage_bucket(constchar*bucket)
Set the Google Cloud Storage bucket name, e.g.
\"abc-xyz-123.storage.firebase.com\".
storage_bucket
constchar*storage_bucket()const
Get the Google Cloud Storage bucket name,.
See also:set_storage_bucket().
Public static functions
LoadFromJsonConfig
AppOptions*LoadFromJsonConfig(constchar*config,AppOptions*options)
Load options from a config string.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
| ||||
| Returns | An instance containing the loaded options if successful. If the options argument to this function is null, this method returns anAppOptions instance allocated from the heap. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.