[Free] Firebase Realtime Database Extension

:blue_book: FBRealtimeDatabase – Extension

Package: com.fbrealtimedatabase

Version: 1

Description: Firebase Realtime Database extension which simplifies REST API calls

1. Overview

This extension allows you to store, read, delete and list data from Firebase Realtime Database using REST API.

Supports auth token and dynamic Firebase paths.

2. Properties

-–

:pushpin: DatabaseUrl (String)

component_set_get (1)

Firebase database URL.

Example:

https://your-app-default-rtdb.firebaseio.com

-–

:pushpin: ProjectBucket (String)

component_set_get (2)

Top-level folder where all data is stored.

Examples:

Users

Users/India

DeviceData

-–

:pushpin: AuthToken (String)

component_set_get

Authentication token appended as ?auth=TOKEN.

If Firebase rules are "admin write

only," this token is required.

3. Functions

-–

:right_arrow: AddChild(tag, key, value)

component_method

Stores a value at ProjectBucket/tag/key

Example:

AddChild(β€œDEVICE1234”, β€œUsername”, β€œXYZ”)

Fires Event:

StoreKeyValueDone(success, response)

-–

:right_arrow: GetTagList()

component_method (1)

Returns all child keys inside ProjectBucket.

Fires Event

TagListReceived(list)

-–

:right_arrow: GetValue(path)

component_method (2)

Reads content from the given path inside project bucket.

_Example input:_

DEVICE1234/userName

Fires Event

ValueReceived(path, rawValue)

-–

:right_arrow: RemoveValue(path)

component_method (3)

Deletes the value at:

ProjectBucket/path

Fires Event

RemoveValueDone(path, success, response)

-–

4.Events

-–

:loudspeaker: StoreKeyValueDone(success, response)

component_event (2)

Called after AddChild completes.

-–

:loudspeaker: TagListReceived(tagList)

component_event (3)

Returns all child keys of ProjectBucket.

-–

:loudspeaker: ValueReceived(path, rawValue)

component_event (4)

Returns value received from GetValue. tag value or key value.

-–

:loudspeaker: RemoveValueDone(path, success, response)

component_event (1)

Called after Delete operation is completed.

-–

:loudspeaker: FirebaseError(functionName, errorMessage)

component_event

Fired when any Firebase request fails.

-–

5. Usage Examples

-–

*:check_mark: Initialize Extension*

FB.DatabaseUrl(β€œhttps://your-app.firebaseio.com”)

FB.ProjectBucket(β€œUsers”)

FB.AuthToken(β€œYOUR_SECRET_TOKEN”) // optional

-–

:check_mark: Store Data

FB.AddChild(β€œDEVICE1234”, β€œuserName”, β€œXYZ”)
tag:DEVICE1234, key: userName, value:XYZ

Event:

StoreKeyValueDone(success, response)

-–

:check_mark: Read Data

FB.GetValue (β€œtag/key”) or (β€œtag”)

Event:

ValueReceived(path, rawValue)

-–

:check_mark: Delete Data

FB.RemoveValue(β€œtag/key”) or (tag)

Event:

RemoveValueDone(path, success, response)

-–

:check_mark: Get All Nodes

FB.GetTagList()

Event:

TagListReceived(tagList)

AIX Download :-

FBRealtimeDatabase.aix (17.4 KB)

:heart: If you love it, buy me a coffee :hot_beverage:

IMG_20251125_124403

1 Like