FIRDatabase


@interface FIRDatabase : 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].

  • The NSObject initializer that has been marked as unavailable. Use the database method instead

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Return Value

    An instancetype instance

  • Gets the instance of FIRDatabase for the default FIRApp.

    Declaration

    Objective-C

    + (nonnull FIRDatabase *)database;

    Return Value

    A FIRDatabase instance.

  • Gets a FirebaseDatabase instance for the specified URL.

    Declaration

    Objective-C

    + (nonnull FIRDatabase *)databaseWithURL:(nonnull NSString *)url;

    Parameters

    url

    The URL to the Firebase Database instance you want to access.

    Return Value

    A FIRDatabase instance.

  • Gets a FirebaseDatabase instance for the specified URL, using the specified FirebaseApp.

    Declaration

    Objective-C

    + (nonnull FIRDatabase *)databaseForApp:(nonnull FIRApp *)app
                                        URL:(nonnull NSString *)url;

    Parameters

    app

    The FIRApp to get a FIRDatabase for.

    url

    The URL to the Firebase Database instance you want to access.

    Return Value

    A FIRDatabase instance.

  • Gets an instance of FIRDatabase for a specific FIRApp.

    Declaration

    Objective-C

    + (nonnull FIRDatabase *)databaseForApp:(nonnull FIRApp *)app;

    Parameters

    app

    The FIRApp to get a FIRDatabase for.

    Return Value

    A FIRDatabase instance.

  • app

    The FIRApp instance to which this FIRDatabase belongs.

    Declaration

    Objective-C

    @property (readonly, nonatomic) FIRApp *_Nullable app;
  • Gets a FIRDatabaseReference for the root of your Firebase Database.

    Declaration

    Objective-C

    - (nonnull FIRDatabaseReference *)reference;
  • Gets a FIRDatabaseReference for the provided path.

    Declaration

    Objective-C

    - (nonnull FIRDatabaseReference *)referenceWithPath:(nonnull NSString *)path;

    Parameters

    path

    Path to a location in your Firebase Database.

    Return Value

    A FIRDatabaseReference pointing to the specified path.

  • 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.

    Declaration

    Objective-C

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