Free Firebase Database

đź§© FirebaseDatabaseExtended

An extension for MIT App Inventor 2.
Firebase Realtime Database Extension using REST API. Developed by Jamar using Fast.

:memo: Overview

FirebaseDatabaseExtended is a lightweight yet powerful extension designed to simplify and standardize Firebase Realtime Database interactions in MIT App Inventor–based environments.
It addresses inconsistencies observed in the default Firebase component and introduces structured JSON handling, controlled data merging, synchronous and asynchronous access methods, and improved error reporting.

This extension is particularly suited for developers who require,

  • Deterministic key–value storage (non-list-based)
  • JSON-to-dictionary mapping
  • Append/merge operations without overwriting existing data
  • Explicit success and error callbacks

:gear: Specifications


:bell: Events

FirebaseDatabaseExtended exposes a total of 5 events:

1. OnStoreSuccess

Triggered when data is successfully stored in Firebase.

Parameter Type
path text

2. OnAppendSuccess

Triggered when data is successfully appended or merged at a Firebase path.

Parameter Type
path text

3. OnGetSuccess

Triggered when data is successfully retrieved from Firebase.

Parameter Type
path text
value text

4. OnError

Triggered when an error occurs during any Firebase operation.

Parameter Type
functionName text
errorMessage text

5. OnConnectionTestComplete

Triggered after a Firebase connectivity test completes.

Parameter Type
success boolean
message text

:puzzle_piece: Methods

FirebaseDatabaseExtended provides 12 methods:

1. StoreAtPath

Stores a single key–value pair at a specified Firebase path.
Existing data at that path is overwritten.

Parameter Type
path text
key text
value any

2. StoreValueFromJSON

Parses a JSON string and stores all key–value pairs at the specified path.

Example JSON:

{"name":"John","age":25}
Parameter Type
path text
jsonText text

3. AppendAtPath

Adds or updates a single key–value pair without overwriting other data at the same path.

Parameter Type
path text
key text
value any

4. AppendFromJSON

Parses a JSON string and merges all key–value pairs with existing data.

Parameter Type
path text
jsonText text

5. GetValue

Retrieves a specific value by key from a Firebase path.
Returns an empty string if the key does not exist.

Parameter Type
path text
key text

6. GetAllValues

Retrieves all key–value pairs at a Firebase path as a JSON string.

Parameter Type
path text

7. DeleteAtPath

Deletes all data at the specified Firebase path.

Parameter Type
path text

8. TestConnection

Tests the current Firebase configuration and connectivity.

9. ValidateJSON

Checks whether the provided text is a valid JSON string.

  • Return type: boolean
Parameter Type
jsonText text

10. CreateJSON

Generates a JSON string from multiple key–value pairs.

Example:

CreateJSON("name", "John", "age", 25)
  • Return type: text
Parameter Type
keyValuePairs any

11. GetValueSync

Synchronously retrieves a value from Firebase.
:warning: Blocks execution until a response is received; use cautiously to avoid UI freezes.

  • Return type: text
Parameter Type
path text
key text

12. GetAllValuesSync

Synchronously retrieves all values at a Firebase path as a JSON string.

  • Return type: text
Parameter Type
path text

:artist_palette: Designer Properties

FirebaseDatabaseExtended includes 3 designer properties:

1. FirebaseDatabaseUrl

  • Type: string
  • Default: https://your-project.firebaseio.com/

2. FirebaseApiKey

  • Type: string

3. ProjectIdBucket

  • Type: string

:wrench: Setter Properties

FirebaseDatabaseUrl

The Firebase Realtime Database URL.
Must end with a trailing slash (/).

FirebaseApiKey

Your Firebase Web API Key
(Firebase Console → Project Settings → Web API Key).

ProjectIdBucket

Optional project ID bucket.
Typically not required for standard operations.


:outbox_tray: Getter Properties

Each getter returns the currently configured value:

  • FirebaseDatabaseUrl → text
  • FirebaseApiKey → text
  • ProjectIdBucket → text

Blocks


AIX
com.firebaseextended.oi.firebasedatabaseextended.aix (20.0 KB)


:folded_hands: Acknowledgements & Notes

This extension was created to mitigate inconsistent behavior observed in the default Firebase component.
Special thanks to @jewel for the Fast CL
, which significantly simplifies extension development and publishing, thank to @curious_singh for this thread, it boosted something :smiley:

Quick sample usage


blocks(68)

Additional features and improvements are planned and will be released in upcoming updates.

8 Likes

Ah, thank you so much for this quick development. I hope this is going to be helpful for those who just want to use firebase component in their projects. This extension will be a HUGE help!

1 Like

Good work dear…

(Just sharing my view) If possible pls add some formula, i mean calling specific value from each key or sorting liekweise. then your extension will be outstanding one. so users no need to use multiple extension or complex code to simplyfy theri work.

Am i correct?

1 Like

Thanks :folded_hands:

Yes you’re correct and we’re connecting :hugs::grin:

:tada::clap:

1 Like

You may have handled this, but given your example (“Quick sample usage”) where you appear to have created a firebase array, you might consider what happens:

1 Like

In my case, the numeric-looking nodes (e.g., 1 = John) are not being generated as Firebase arrays via push(). They originate directly from the JSON structure I am supplying, where those values are explicit keys, not positional indexes.

For example, if I use a structure like,

name = "Ibrahim Jamar"
platform = "Kodular"

the intention is to treat the data as a key–value map, not as a mutable list. These keys are fixed identifiers coming from the source JSON, and they are not reordered, shifted, or deleted dynamically.

I will rearrange it​:hugs: I don’t know if I get u clear

It will be about what comes back from a query, and also if you try to delete one of the elements, e.g. 7:"7" - you could end up with an empty element.

1 Like