Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

How to get value from FirebaseObject? #337

Closed
@Kamoba

Description

@Kamoba

I have this in Firebase
/Box
-Ball: "red"
-marbles: 12
-cats: 5

so i would like to get all the list once and work on it.
I did :

FirebaseObject MyFirebase_Object = Firebase.get("Box");       // or "/Box" i get true on success()
if(Firebase.success()){
  Serial.println("success");
}

With get() we should receive an object FirebaseObject containing json.
So to get value i tested:

     // with     #include <ArduinoJson.h>
DynamicJsonDocument doc;
DeserializationError error = deserializeJson(doc, MyFirebase_Object);
if (error) {
  }
JsonObject& obj = doc.as<JsonObject>();
obj.prettyPrintTo(Serial);

Result: error: no type named 'const_iterator' in 'class FirebaseObject'

and

String n = MyFirebase_Object.getString("Ball");     // even MyFirebase_Object.getString();
Serial.println(n);

Result: empty string

if i used "/data/Box" as path on Firebase.get() instead i get this on Serial when Serial.println(n):

Exception (28):
epc1=0x4020add2 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3fff0420 end: 3fff0860 offset: 01a0

>>>stack>>>
3fff05c0:  3fffdad0 3fff05f0 3fff0820 40205d4d
....

I know how to getString values individually from Firebase.
Somebody know how to get the values from the FirebaseObject object received?
An example how to use FirebaseObject.getSting()?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions