FirebaseDB

Last Updated On 2021-07-16

Version 3MinSDK 10Tutorial Video

Non-visible component that communicates with a Firebase to store and retrieve information.


Properties

You can set the below properties in the UI part of the builder.

  • DefaultURL - it's a string value which is set to blank by default.
  • DeveloperBucket - it's a string value which is set to blank by default.
  • FirebaseToken - it's a string value which is set to blank by default.
  • FirebaseURL - it's a FirbaseURL value which is set to default by default.
  • Persist - it's a boolean value which is set to false by default.
  • ProjectBucket - it's a string value which is set to blank by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

DeveloperBucket

Specifies the unique developer path of the Firebase.


FirebaseToken

Specifies the token for the default Firebase.


FirebaseURL

Gets the URL for this FirebaseDB.


ProjectBucket

Sets the ProjectBucket for this FirebaseDB.



Methods

You can set the below method blocks in the blocks section of the builder.

AppendValue

Append a value to the end of a list atomically. If two devices use this function simultaneously, both will be appended and no data lost.

ClearTag

Remove the tag from Firebase

GetTagList

Get the list of tags for this application. When complete a "TagList" event will be triggered with the list of known tags.

GetValue

GetValue asks Firebase to get the value stored under the given tag. It will pass valueIfTagNotThere to GotValue if there is no value stored under the tag.

RemoveFirst

Return the first element of a list and atomically remove it. If two devices use this function simultaneously, one will get the first element and the the other will get the second element, or an error if there is no available element. When the element is available, the "FirstRemoved" event will be triggered.

StoreValue

Asks Firebase to store the given value under the given tag.

Unauthenticate

If you are having difficulty with the Companion and you are switching between different Firebase accounts, you may need to use this function to clear internal Firebase caches. You can just use the "Do It" function on this block in the blocks editor. Note: You should not normally need to use this block as part of an application.


Events

You can set the below event blocks in the blocks section of the builder.

DataChanged

Indicates that the data in the Firebase has changed. Launches an event with the tag and value that have been updated.

FirebaseError

Indicates that the communication with the Firebase signaled an error.

FirstRemoved

Event triggered by the "RemoveFirst" function. The argument "value" is the object that was the first in the list, and which is now removed.

GotValue

Indicates that a GetValue request has succeeded.

TagList

Event triggered when we have received the list of known tags. Used with the "GetTagList" Function.