Multiple client connections for single Firebase client JVM

133 views
Skip to first unread message

Serhii Pererva

unread,
Dec 27, 2015, 11:48:32 AM12/27/15
to Firebase Google Group
Hi!

I am developing an integration with Nest Protect device and connect with their API using com.firebase.firebase-client-jvm Java library using Scala programming language.

Everything worked fine till the moment I've started using my implementation using multiple Nest accounts (which is mapped directly to Firebase users in structure) at the same time.

new Firebase("...") constructor doesn't produce new instances but modifies the old one - changing all of the event listeners and authentication state.

That basically means that for one client program there is only one authenticated user is possible at particular point in time. I am listening to Nest Protect device state change so I need a multiple users authenticated at the same time so for every of them I will receive a corresponding event.

I've tried giving Firebase constructor a different URL for each user - I've read somewhere that will produce a different object for different URL but that is not true

In general I have the same question as described here http://stackoverflow.com/questions/28242306/how-to-use-firebase-client-to-connect-to-nest-api-using-multiple-client-connecti but for LVM library. There is a workaround described with undocumented constructor new Firebase('wss://developer-api.nest.com', new Firebase.Context()). Is there something like that in JVM library?

I am aware that this could be implemented using plain HTTP REST calls but that solution is not fast enough.

Is there any suggestions how multiple client connections for single Firebase client could be implemented using JVM library?

I understand that that Firebase is originally not supposed to be used like this but it would be nice if I could implement it as I've described.

Regards,
Serhii
 

Jacob Wenger

unread,
Dec 27, 2015, 1:36:39 PM12/27/15
to fireba...@googlegroups.com
Hey Serhii,

Check out this StackOverflow post for an undocumented feature that you can make use of. Since this is an undocumented feature, note that it may break in future versions without warning. We may add this as a documented, fully supported feature in the future. 

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/d38c6fa4-2ede-4d4e-82bf-dfa5adbf14eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages