LuxChat  2.0
Instant messenger for iOS
Instance Methods | Class Methods | Properties | List of all members
FIRDatabase Class Reference

#import <FIRDatabase.h>

Inheritance diagram for FIRDatabase:

Instance Methods

(FIRDatabaseReference *) - reference
 
(FIRDatabaseReference *) - referenceWithPath:
 
(FIRDatabaseReference *) - referenceFromURL:
 
(void) - purgeOutstandingWrites
 
(void) - goOffline
 
(void) - goOnline
 

Class Methods

(database() + NS_SWIFT_NAME
 
(FIRDatabase *) + databaseForApp:
 
(void) + setLoggingEnabled:
 
(NSString *) + sdkVersion
 

Properties

FIRAppapp
 
BOOL persistenceEnabled
 
dispatch_queue_t callbackQueue
 

Detailed Description

The entry point for accessing a Firebase Database. You can get an instance by calling [FIRDatabase database]. To access a location in the database and read or write data, use [FIRDatabase reference].

Method Documentation

+ (FIRDatabase *) databaseForApp: (database(app:))  NS_SWIFT_NAME

Gets an instance of FIRDatabase for a specific FIRApp.

Parameters
appThe FIRApp to get a FIRDatabase for.
Returns
A FIRDatabase instance.
- (void) goOffline

Shuts down our connection to the Firebase Database backend until goOnline is called.

- (void) goOnline

Resumes our connection to the Firebase Database backend after a previous goOffline call.

+ (database() NS_SWIFT_NAME

Gets the instance of FIRDatabase for the default FIRApp.

Returns
A FIRDatabase instance.
- (void) purgeOutstandingWrites

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 Database backend.

- (FIRDatabaseReference *) reference

Gets a FIRDatabaseReference for the root of your Firebase Database.

- (FIRDatabaseReference *) referenceFromURL: (NSString *)  databaseUrl

Gets a FIRDatabaseReference for the provided URL. The URL must be a URL to a path within this Firebase Database. To create a FIRDatabaseReference to a different database, create a FIRApp} with a FIROptions object configured with the appropriate database URL.

Parameters
urlA URL to a path within your database.
Returns
A FIRDatabaseReference for the provided URL.
- (FIRDatabaseReference *) referenceWithPath: (NSString *)  path

Gets a FIRDatabaseReference for the provided path.

Parameters
pathPath to a location in your Firebase Database.
Returns
A FIRDatabaseReference pointing to the specified path.
+ (NSString *) sdkVersion

Retrieve the Firebase Database SDK version.

+ (void) setLoggingEnabled: (BOOL)  enabled

Enables verbose diagnostic logging.

Parameters
enabledYES to enable logging, NO to disable.

Property Documentation

- (FIRApp*) app
readnonatomicweak

The FIRApp instance to which this FIRDatabase belongs.

- (dispatch_queue_t) callbackQueue
readwritenonatomicstrong

Sets the dispatch queue on which all events are raised. The default queue is the main queue.

Note that this must be set before creating your first Database reference.

- (BOOL) persistenceEnabled
readwritenonatomicassign

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 YES, 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 property must be set before creating your first Database reference and only needs to be called once per application.


The documentation for this class was generated from the following file: