@@ -34,7 +34,7 @@ static std::string kLibraryName = "flutter-fire-core";
34
34
35
35
// static
36
36
void FirebaseCorePlugin::RegisterWithRegistrar (
37
- flutter::PluginRegistrarWindows * registrar) {
37
+ flutter::PluginRegistrarWindows* registrar) {
38
38
auto plugin = std::make_unique<FirebaseCorePlugin>();
39
39
40
40
FirebaseCoreHostApi::SetUp (registrar->messenger (), plugin.get ());
@@ -53,7 +53,7 @@ FirebaseCorePlugin::~FirebaseCorePlugin() = default;
53
53
54
54
// Convert a CoreFirebaseOptions to a Firebase Options.
55
55
firebase::AppOptions CoreFirebaseOptionsToAppOptions (
56
- const CoreFirebaseOptions & pigeon_options) {
56
+ const CoreFirebaseOptions& pigeon_options) {
57
57
firebase::AppOptions options;
58
58
options.set_api_key (pigeon_options.api_key ().c_str ());
59
59
options.set_app_id (pigeon_options.app_id ().c_str ());
@@ -74,39 +74,39 @@ firebase::AppOptions CoreFirebaseOptionsToAppOptions(
74
74
}
75
75
76
76
// Convert a AppOptions to CoreFirebaseOptions
77
- CoreFirebaseOptions optionsFromFIROptions (const firebase::AppOptions & options) {
77
+ CoreFirebaseOptions optionsFromFIROptions (const firebase::AppOptions& options) {
78
78
CoreFirebaseOptions pigeon_options =
79
79
CoreFirebaseOptions (options.api_key (), options.app_id (),
80
80
options.messaging_sender_id (), options.project_id ());
81
81
// AppOptions initialises as empty char so we check to stop empty string to
82
82
// Flutter Same for storage bucket below
83
- const char * db_url = options.database_url ();
83
+ const char * db_url = options.database_url ();
84
84
if (db_url != nullptr && db_url[0 ] != ' \0 ' ) {
85
85
pigeon_options.set_database_u_r_l (db_url);
86
86
}
87
87
pigeon_options.set_tracking_id (nullptr );
88
88
89
- const char * storage_bucket = options.storage_bucket ();
89
+ const char * storage_bucket = options.storage_bucket ();
90
90
if (storage_bucket != nullptr && storage_bucket[0 ] != ' \0 ' ) {
91
91
pigeon_options.set_storage_bucket (storage_bucket);
92
92
}
93
93
return pigeon_options;
94
94
}
95
95
96
96
// Convert a firebase::App to CoreInitializeResponse
97
- CoreInitializeResponse AppToCoreInitializeResponse (const App & app) {
97
+ CoreInitializeResponse AppToCoreInitializeResponse (const App& app) {
98
98
flutter::EncodableMap plugin_constants;
99
99
CoreInitializeResponse response = CoreInitializeResponse (
100
100
app.name (), optionsFromFIROptions (app.options ()), plugin_constants);
101
101
return response;
102
102
}
103
103
104
104
void FirebaseCorePlugin::InitializeApp (
105
- const std::string & app_name,
106
- const CoreFirebaseOptions & initialize_app_request,
105
+ const std::string& app_name,
106
+ const CoreFirebaseOptions& initialize_app_request,
107
107
std::function<void (ErrorOr<CoreInitializeResponse> reply)> result) {
108
108
// Create an app
109
- App * app =
109
+ App* app =
110
110
App::Create (CoreFirebaseOptionsToAppOptions (initialize_app_request),
111
111
app_name.c_str ());
112
112
@@ -118,14 +118,14 @@ void FirebaseCorePlugin::InitializeCore(
118
118
std::function<void (ErrorOr<flutter::EncodableList> reply)> result) {
119
119
// TODO: Missing function to get the list of currently initialized apps
120
120
std::vector<CoreInitializeResponse> initializedApps;
121
- std::vector<App *> all_apps = App::GetApps ();
122
- for (const App * app : all_apps) {
121
+ std::vector<App*> all_apps = App::GetApps ();
122
+ for (const App* app : all_apps) {
123
123
initializedApps.push_back (AppToCoreInitializeResponse (*app));
124
124
}
125
125
126
126
flutter::EncodableList encodableList;
127
127
128
- for (const auto & item : initializedApps) {
128
+ for (const auto & item : initializedApps) {
129
129
encodableList.push_back (flutter::CustomEncodableValue (item));
130
130
}
131
131
result (encodableList);
@@ -135,19 +135,19 @@ void FirebaseCorePlugin::OptionsFromResource(
135
135
std::function<void (ErrorOr<CoreFirebaseOptions> reply)> result) {}
136
136
137
137
void FirebaseCorePlugin::SetAutomaticDataCollectionEnabled (
138
- const std::string & app_name, bool enabled,
138
+ const std::string& app_name, bool enabled,
139
139
std::function<void (std::optional<FlutterError> reply)> result) {
140
- App * firebaseApp = App::GetInstance (app_name.c_str ());
140
+ App* firebaseApp = App::GetInstance (app_name.c_str ());
141
141
if (firebaseApp != nullptr ) {
142
142
// TODO: Missing method
143
143
}
144
144
result (std::nullopt );
145
145
}
146
146
147
147
void FirebaseCorePlugin::SetAutomaticResourceManagementEnabled (
148
- const std::string & app_name, bool enabled,
148
+ const std::string& app_name, bool enabled,
149
149
std::function<void (std::optional<FlutterError> reply)> result) {
150
- App * firebaseApp = App::GetInstance (app_name.c_str ());
150
+ App* firebaseApp = App::GetInstance (app_name.c_str ());
151
151
if (firebaseApp != nullptr ) {
152
152
// TODO: Missing method
153
153
}
@@ -156,9 +156,9 @@ void FirebaseCorePlugin::SetAutomaticResourceManagementEnabled(
156
156
}
157
157
158
158
void FirebaseCorePlugin::Delete (
159
- const std::string & app_name,
159
+ const std::string& app_name,
160
160
std::function<void (std::optional<FlutterError> reply)> result) {
161
- App * firebaseApp = App::GetInstance (app_name.c_str ());
161
+ App* firebaseApp = App::GetInstance (app_name.c_str ());
162
162
if (firebaseApp != nullptr ) {
163
163
// TODO: Missing method
164
164
}
0 commit comments