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
415 stars 118 forks source link

Add OnDisconnect Handler #110

Closed Keegan-Cruickshank closed 3 years ago

Keegan-Cruickshank commented 3 years ago

I am looking to add presence to my ESP32. A great way to do this is described here: https://firebase.googleblog.com/2013/06/how-to-build-presence-system.html

I think you are using something similar to their c++ library so I assume you could implement this: https://firebase.google.com/docs/reference/cpp/class/firebase/database/disconnection-handler

I have of course thought of just using date refs and polling that every few mins but this method would be much cleaner.

I think this would be a great feature to allow users to know when their esp32 is online and offline with just a few lines of code.

mobizt commented 3 years ago

The feature you mentioned is not possible in REST APIs (http) and it's only available on the supported platforms that Firebase SDK or Firebase Admin SDK was installed.

mobizt commented 3 years ago

It's not pure C++ but requires the SDK to install in the supported platform not limited resources and unsupported embedded device.

Keegan-Cruickshank commented 3 years ago

Yes I understand, Thanks for the snappy reply. Might have to live with the date snapshot uploaded periodically. Just not sure of the scalability there.