getDatabaseWithUrl method
Gets the {@link Database} service for the default app or a given app.
getDatabaseWithUrl()
can be called with no arguments to access the default
app's {@link Database} service or as getDatabaseWithUrl(app)
to access the
{@link Database} service associated with a specific app.
@example
// Get the Database service for the default app
const defaultDatabase = getDatabaseWithUrl('https://example.firebaseio.com');
@example
// Get the Database service for a specific app
const otherDatabase = getDatabaseWithUrl('https://example.firebaseio.com', app);
@param App - whose Database
service to
return. If not provided, the default Database
service will be returned.
@returns The default Database
service if no app
is provided or the Database
service associated with the provided app.
Implementation
external Database getDatabaseWithUrl(String url, [App app]);