Skip to content

firebase c++ sdk on android firebase::app::create with AppOption return NULL #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chanhbc opened this issue Jul 12, 2018 · 2 comments
Closed

Comments

@chanhbc
Copy link

chanhbc commented Jul 12, 2018

I create sdk firebase c++ on Android, I use the google_service.json configuration file when everything is fine, but when I use :: firebase :: AppOption to configure then it returns NULL, please tell me I made a mistake where, thanks you so much

::firebase::App *app;
::firebase::AppOptions appOptions;
appOptions = firebase::AppOptions();

const char *api_key = "";
const char *app_id = "";
const char *database_url = "";
const char *messaging_sender_id = "";
const char *project_id = "";
const char *storage_bucket = "";
appOptions.set_api_key(api_key);
appOptions.set_app_id(app_id);
appOptions.set_database_url(database_url);
appOptions.set_messaging_sender_id(messaging_sender_id);
appOptions.set_project_id(project_id);
appOptions.set_storage_bucket(storage_bucket);

app = ::firebase::App::Create(appOptions, app_id, jni_env, activity); // result NULL
@a-maurice
Copy link
Contributor

Hi there, sorry for the delay in getting back to you.

Just to clarify, are you passing in the correct fields from the Firebase console for all of those empty strings? I've only been able to reproduce this by having incorrect values for those. You can either get those fields from the Firebase console, or by looking at the google_services.json file, which will also have them included.

@stewartmiles
Copy link
Contributor

@chanhbc since we haven't heard from you we'll assume you've resolved your issue. If you still have a problem please respond with more information.

@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants