B4J Question [ Jserver ] how to use JFirebaseServer in a websocket handler with Jserver?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
Hi everyone, I'm having trouble using JFirebaseServer with a websocket handler.
when connecting +2 users, from the 2nd an error occurs:
B4X:
java.lang.IllegalStateException: FirebaseApp name [DEFAULT] already exists!

Websocket Handler ex:
B4X:
Sub Device_VerifyToken(Params As Map)
    firebaseId = Params.Get("token")
    Log("tokeid = "&firebaseId)
    fs.VerifyToken(firebaseId)
End Sub

Sub fs_TokenVerified (TokenId As String, Success As Boolean, Token As FirebaseToken)
    If Success Then
        Log(Token.DisplayName)
        Log(Token.Email)
        Log(Token.Uid)
    Else
        Log("Error...")
    End If
End Sub

What to do in this case ?
 
Top