A new version of the library has been released including the following and more:
And now a example for using:
B4X:
onDisconnectSetValue 'if you lost your conncection or the user is close the app, then you can set here a value, this is then set.
onDisconnectRemove 'the same, but only here is the value deleted.
And now a example for using:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim typingref As DatabaseReference
Dim realtime As FirebaseDatabase
typingref.Initialize("istyping",realtime.getReference2("/rooms/" & "MyRoomId & "/typingIndicator"),"chats")
typingref.addChildEventListener
typingref.onDisconnectSetValue(CreateMap("MyIdOrColumn" : False)) 'if i disconnect or i lost my connection to the Database, then the Value set to false
'for example i write a text and then i lost my connection, then set the value to false and my chat partner know that i dont writing anymore, because i lost my connection.
typingref.goOnline
typingref.keepSynced(True)
End Sub