mobizt / Firebase-ESP32

[DEPRECATED]🔥 Firebase RTDB Arduino Library for ESP32. The complete, fast, secured and reliable Firebase Arduino client library that supports CRUD (create, read, update, delete) and Stream operations.
MIT License
414 stars 119 forks source link

Can't send json to Firebase (please help) #187

Closed juliusfelix12 closed 2 years ago

juliusfelix12 commented 2 years ago

Hi sir, why i can't send JSON string to firebase, which part i do wrong?? I used to read the documentation and still not find the solution, please help thankyou. image

I expect the output on firebase will be like this image

mobizt commented 2 years ago

You should read the document. https://github.com/mobizt/Firebase-ESP32/tree/master/src#set-child-nodes-key-and-value-using-firebasejson-object-to-the-defined-database-path

You can't set the serialized JSON string to that function which accepts only FirebaseJson object.

The library has built-in JSON builder and parser, FirebaseJson to serialize and deserialize JSON which is easier and efficient.

mobizt commented 2 years ago

The examples related to FirebaseJson are here.

mobizt commented 2 years ago

You should update the library to latest version to use the new core of FirebaseJson which is powered by the best JSON parser, cJSON.

mobizt commented 2 years ago

This is the example when using FirebaseJson and Firebase RTDB.

juliusfelix12 commented 2 years ago

thankyou sir for helping!

juliusfelix12 commented 2 years ago

sir @mobizt , i already read and apply code from the documentation like this and it works! image

but why it doesn't generate random key like this as a child for every read data?? image

my firebase console look like this, doesnt generate random key like the above pict image

pls help thanks

mobizt commented 2 years ago

You can use pushJSON to push the new random key name to that node.

juliusfelix12 commented 2 years ago

thanks a lot sir!!!