bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
690 stars 146 forks source link

Event Streaming not working #135

Open tblack2200 opened 5 years ago

tblack2200 commented 5 years ago

I've successfully setup Firebase Realtime Database event streaming in Android, but failing in VB.NET. I can connect and manually read\write, but just can't get listener to work. Any help is greatly appreciated.

Private Async Sub EventStreaming()
    Dim strTest As String = Nothing
    Try
        objListener = Await objClient.OnAsync("alert", Function(s, args, context)
                                                           System.Console.WriteLine(args.Data)
                                                       End Function)
        strErrMsg = ""

    Catch ex As Exception
        strErrMsg = ex.Message
    End Try
End Sub

Private Async Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Try
        objConfig = New FirebaseConfig()
        With objConfig
            .AuthSecret = "<Secret>
            .BasePath = "<Path>"
        End With

        objClient = New FireSharp.FirebaseClient(objConfig)

        If objClient IsNot Nothing Then
            EventStreaming()
        End If

    Catch ex As Exception
        strErrMsg = ex.Message
    End Try
End Sub