Classes

The following classes are available globally.

  • A FIRDataSnapshot contains data from a Firebase Database location. Any time you read Firebase data, you receive the data as a FIRDataSnapshot.

    FIRDataSnapshots are passed to the blocks you attach with observeEventType:withBlock: or observeSingleEvent:withBlock:. They are efficiently-generated immutable copies of the data at a Firebase Database location. They can’t be modified and will never change. To modify data at a location, use a FIRDatabaseReference (e.g. with setValue:).

    Declaration

    Swift

    class DataSnapshot : NSObject

    Objective-C

    
    @interface FIRDataSnapshot : NSObject
  • 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].

    Declaration

    Swift

    class Database : NSObject

    Objective-C

    
    @interface FIRDatabase : NSObject
  • A FIRDatabaseQuery instance represents a query over the data at a particular location.

    You create one by calling one of the query methods (queryOrderedByChild:, queryStartingAtValue:, etc.) on a FIRDatabaseReference. The query methods can be chained to further specify the data you are interested in observing

    Declaration

    Swift

    class DatabaseQuery : NSObject

    Objective-C

    
    @interface FIRDatabaseQuery : NSObject
  • A FIRDatabaseReference represents a particular location in your Firebase Database and can be used for reading or writing data to that Firebase Database location.

    This class is the starting point for all Firebase Database operations. After you’ve obtained your first FIRDatabaseReference via [FIRDatabase reference], you can use it to read data (ie. observeEventType:withBlock:), write data (ie. setValue:), and to create new FIRDatabaseReferences (ie. child:).

    Declaration

    Swift

    class DatabaseReference : DatabaseQuery

    Objective-C

    
    @interface FIRDatabaseReference : FIRDatabaseQuery
  • A FIRMutableData instance is populated with data from a Firebase Database location. When you are using runTransactionBlock:, you will be given an instance containing the current data at that location. Your block will be responsible for updating that instance to the data you wish to save at that location, and then returning using [FIRTransactionResult successWithValue:].

    To modify the data, set its value property to any of the native types support by Firebase Database:

    • NSNumber (includes BOOL)
    • NSDictionary
    • NSArray
    • NSString
    • nil / NSNull to remove the data

    Note that changes made to a child FIRMutableData instance will be visible to the parent.

    Declaration

    Swift

    class MutableData : NSObject

    Objective-C

    
    @interface FIRMutableData : NSObject
  • Placeholder values you may write into Firebase Database as a value or priority that will automatically be populated by the Firebase Database server.

    Declaration

    Swift

    class ServerValue : NSObject

    Objective-C

    
    @interface FIRServerValue : NSObject
  • Used for runTransactionBlock:. An FIRTransactionResult instance is a container for the results of the transaction.

    Declaration

    Swift

    class TransactionResult : NSObject

    Objective-C

    
    @interface FIRTransactionResult : NSObject