@@ -89,7 +89,8 @@ class TransactionManager;
89
89
class Firestore {
90
90
public:
91
91
/* *
92
- * @brief Returns an instance of Firestore corresponding to the given App.
92
+ * @brief Returns an instance of Firestore corresponding to the given App
93
+ * with default database ID.
93
94
*
94
95
* Firebase Firestore uses firebase::App to communicate with Firebase
95
96
* Authentication to authenticate users to the Firestore server backend.
@@ -104,13 +105,15 @@ class Firestore {
104
105
* succeeded, or firebase::kInitResultFailedMissingDependency on Android if
105
106
* Google Play services is not available on the current device.
106
107
*
107
- * @return An instance of Firestore corresponding to the given App.
108
+ * @return An instance of Firestore corresponding to the given App with
109
+ * default database ID.
108
110
*/
109
111
static Firestore* GetInstance (::firebase::App* app,
110
112
InitResult* init_result_out = nullptr );
111
113
112
114
/* *
113
- * @brief Returns an instance of Firestore corresponding to the default App.
115
+ * @brief Returns an instance of Firestore corresponding to the default App
116
+ * with default database ID.
114
117
*
115
118
* Firebase Firestore uses the default App to communicate with Firebase
116
119
* Authentication to authenticate users to the Firestore server backend.
@@ -122,10 +125,60 @@ class Firestore {
122
125
* succeeded, or firebase::kInitResultFailedMissingDependency on Android if
123
126
* Google Play services is not available on the current device.
124
127
*
125
- * @return An instance of Firestore corresponding to the default App.
128
+ * @return An instance of Firestore corresponding to the default App
129
+ * with default database ID.
126
130
*/
127
131
static Firestore* GetInstance (InitResult* init_result_out = nullptr );
128
132
133
+ /* *
134
+ * @brief Returns an instance of Firestore corresponding to the given App with
135
+ * the given database ID.
136
+ *
137
+ * Firebase Firestore uses firebase::App to communicate with Firebase
138
+ * Authentication to authenticate users to the Firestore server backend.
139
+ *
140
+ * If you call GetInstance() multiple times with the same App, you will get
141
+ * the same instance of Firestore.
142
+ *
143
+ * @param[in] app Your instance of firebase::App. Firebase Firestore will use
144
+ * this to communicate with Firebase Authentication.
145
+ * @param[in] db_name Name of the database. Firebase Firestore will use
146
+ * this to communicate with Firebase Authentication.
147
+ * @param[out] init_result_out If provided, the initialization result will be
148
+ * written here. Will be set to firebase::kInitResultSuccess if initialization
149
+ * succeeded, or firebase::kInitResultFailedMissingDependency on Android if
150
+ * Google Play services is not available on the current device.
151
+ *
152
+ * @return An instance of Firestore corresponding to the given App with
153
+ * the given database ID.
154
+ */
155
+ static Firestore* GetInstance (::firebase::App* app,
156
+ const char * db_name,
157
+ InitResult* init_result_out = nullptr );
158
+
159
+ /* *
160
+ * @brief Returns an instance of Firestore corresponding to the default App
161
+ * with the given database ID.
162
+ *
163
+ * Firebase Firestore uses firebase::App to communicate with Firebase
164
+ * Authentication to authenticate users to the Firestore server backend.
165
+ *
166
+ * If you call GetInstance() multiple times with the same App, you will get
167
+ * the same instance of Firestore.
168
+ *
169
+ * @param[in] db_name Name of the database. Firebase Firestore will use
170
+ * this to communicate with Firebase Authentication.
171
+ * @param[out] init_result_out If provided, the initialization result will be
172
+ * written here. Will be set to firebase::kInitResultSuccess if initialization
173
+ * succeeded, or firebase::kInitResultFailedMissingDependency on Android if
174
+ * Google Play services is not available on the current device.
175
+ *
176
+ * @return An instance of Firestore corresponding to the default App with
177
+ * the given database ID.
178
+ */
179
+ static Firestore* GetInstance (const char * db_name,
180
+ InitResult* init_result_out = nullptr );
181
+
129
182
/* *
130
183
* @brief Destructor for the Firestore object.
131
184
*
0 commit comments