Package | com.distriqt.extension.firebase.database |
Class | public final class FirebaseDatabase |
Inheritance | FirebaseDatabase ![]() |
This class represents the Firebase Realtime Database extension.
Property | Defined By | ||
---|---|---|---|
implementation : String [read-only]
The implementation currently in use. | FirebaseDatabase | ||
instance : FirebaseDatabase [static] [read-only]
The singleton instance of the FirebaseDatabase class. | FirebaseDatabase | ||
isSupported : Boolean [static] [read-only]
Whether the current device supports the extensions functionality
| FirebaseDatabase | ||
nativeVersion : String [read-only]
The native version string of the native extension. | FirebaseDatabase | ||
service : FirebaseDatabase [static] [read-only]
The singleton instance of the FirebaseDatabase class. | FirebaseDatabase | ||
version : String [read-only]
The version of this extension. | FirebaseDatabase |
Method | Defined By | ||
---|---|---|---|
Constructor
You should not call this directly, but instead use the singleton access
| FirebaseDatabase | ||
dispose():void
Disposes the extension and releases any allocated resources. | FirebaseDatabase | ||
disposeUnusedReferences():void
During the course of using the Firebase Realtime Database extension
you will be creating and destroying references and queries that may
not get immediately disposed. | FirebaseDatabase | ||
getReference(path:String = null):DatabaseReference
Gets a DatabaseReference for the provided path. | FirebaseDatabase | ||
getReferenceFromUrl(url:String):DatabaseReference
Gets a DatabaseReference for the provided URL. | FirebaseDatabase | ||
getSdkVersion():String
The version for this build of the Firebase Database client
| FirebaseDatabase | ||
goOffline():void
Shuts down the connection to the Firebase Database backend
until goOnline() is called. | FirebaseDatabase | ||
goOnline():void
Resumes the connection to the Firebase Database backend after a
previous goOffline() call. | FirebaseDatabase | ||
init(key:String):void Deprecated: You no longer need to call this function or use an application key [static]
Initialises the extension class for use with the provided key. | FirebaseDatabase | ||
purgeOutstandingWrites():void
The Firebase Database client automatically queues writes and sends them
to the server at the earliest opportunity, depending on network
connectivity. | FirebaseDatabase | ||
setDatabaseUrl(databaseUrl:String):void
Set the url for the database to access
| FirebaseDatabase | ||
setPersistenceEnabled(enabled:Boolean):Boolean
The Firebase Database client will cache synchronized data and keep
track of all writes you've initiated while your application is
running. | FirebaseDatabase |
Constant | Defined By | ||
---|---|---|---|
EXT_CONTEXT_ID : String = com.distriqt.firebase.Database [static] | FirebaseDatabase | ||
VERSION : String = 10.1.0 [static] | FirebaseDatabase |
implementation | property |
implementation:String
[read-only] The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:
Android
iOS
default
unknown
public function get implementation():String
instance | property |
instance:FirebaseDatabase
[read-only] The singleton instance of the FirebaseDatabase class.
public static function get instance():FirebaseDatabase
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
isSupported | property |
isSupported:Boolean
[read-only] Whether the current device supports the extensions functionality
public static function get isSupported():Boolean
nativeVersion | property |
nativeVersion:String
[read-only] The native version string of the native extension.
public function get nativeVersion():String
service | property |
service:FirebaseDatabase
[read-only] The singleton instance of the FirebaseDatabase class.
public static function get service():FirebaseDatabase
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
version | property |
version:String
[read-only] The version of this extension. This will be of the format, MAJOR.MINOR.BUILD
public function get version():String
FirebaseDatabase | () | Constructor |
public function FirebaseDatabase()
Constructor You should not call this directly, but instead use the singleton access
dispose | () | method |
public function dispose():void
Disposes the extension and releases any allocated resources. Once this function
has been called, a call to init
is neccesary again before any of the
extensions functionality will work.
disposeUnusedReferences | () | method |
public function disposeUnusedReferences():void
During the course of using the Firebase Realtime Database extension you will be creating and destroying references and queries that may not get immediately disposed. If you need to manage memory and remove some items you can call this function to dispose any references and queries that have been created and do not have active event listeners. You should make sure that any references you are holding onto either have an event listener or are released after calling this function.
getReference | () | method |
public function getReference(path:String = null):DatabaseReference
Gets a DatabaseReference for the provided path.
Parameters
path:String (default = null ) — Path to a location in your FirebaseDatabase.
|
DatabaseReference — A DatabaseReference pointing to the specified path.
|
getReferenceFromUrl | () | method |
public function getReferenceFromUrl(url:String):DatabaseReference
Gets a DatabaseReference for the provided URL. The URL must be a URL to a path within this FirebaseDatabase. To create a DatabaseReference to a different database, create a FirebaseApp with a FirebaseOptions object configured with the appropriate database URL.
Parameters
url:String — A URL to a path within your database.
|
DatabaseReference — A DatabaseReference for the provided URL.
|
getSdkVersion | () | method |
public function getSdkVersion():String
The version for this build of the Firebase Database client
ReturnsString |
goOffline | () | method |
public function goOffline():void
Shuts down the connection to the Firebase Database backend
until goOnline()
is called.
goOnline | () | method |
public function goOnline():void
Resumes the connection to the Firebase Database backend after a
previous goOffline()
call.
init | () | method |
public static function init(key:String):void
Initialises the extension class for use with the provided key.
Parameters
key:String |
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
purgeOutstandingWrites | () | method |
public function purgeOutstandingWrites():void
The Firebase Database client automatically queues writes and sends them
to the server at the earliest opportunity, depending on network
connectivity. In some cases (e.g. offline usage) there may be a large
number of writes waiting to be sent. Calling this method will purge all
outstanding writes so they are abandoned. All writes will be purged,
including transactions and onDisconnect()
writes.
The writes will be rolled back locally, perhaps triggering events for
affected event listeners, and the client will not (re-)send them to the
Firebase backend.
setDatabaseUrl | () | method |
public function setDatabaseUrl(databaseUrl:String):void
Set the url for the database to access
Parameters
databaseUrl:String |
setPersistenceEnabled | () | method |
public function setPersistenceEnabled(enabled:Boolean):Boolean
The Firebase Database client will cache synchronized data and keep track of all writes you've initiated while your application is running. It seamlessly handles intermittent network connections and re-sends write operations when the network connection is restored. However by default your write operations and cached data are only stored in-memory and will be lost when your app restarts. By setting this value to `true`, the data will be persisted to on-device (disk) storage and will thus be available again when the app is restarted (even when there is no network connectivity at that time). Note that this method must be called before creating your first Database reference and only needs to be called once per application.
Parameters
enabled:Boolean — Set to true to enable disk persistence,
set to false to disable it
|
Boolean — true if successful and false if the extension is in an invalid state
|
EXT_CONTEXT_ID | Constant |
public static const EXT_CONTEXT_ID:String = com.distriqt.firebase.Database
VERSION | Constant |
public static const VERSION:String = 10.1.0