I think the issue not in firebase itself because i can read / write to it without problem the issue only hapen when try receive data using streaming i have reach this advanced stage of project and here is the project on Github
https://github.com/devenv2/WinFormsApp1/tree/master
Exception when using Firebase streaming
Yusuf-3141
50
Reputation points
Hi,
When I try to read data from Firebase using FirebaseDatabase.net Library I receive Newtonsoft.Json.JsonReaderException exeptionn
this code works
Imports Firebase.Database
Imports Firebase.Database.Query
Public Class Form1
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim client As New FirebaseClient("https://abcd.asia-southeast1.firebasedatabase.app/")
Dim gesture = Await client _
.Child("gestures") _
.Child("last_gesture") _
.OnceSingleAsync(Of String)()
If gesture IsNot Nothing Then
Label1.Text = gesture
Else
Label1.Text = "..."
End If
Console.WriteLine(gesture)
End Sub
End Class
but this code does not work when using streaming
Imports Firebase.Database
Imports Firebase.Database.Query
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim client As New FirebaseClient("https://abcd.asia-southeast1.firebasedatabase.app/")
client.Child("gestures").Child("last_gesture").AsObservable(Of String)() _
.Subscribe(Sub(f)
Console.WriteLine(f.Object)
If f.Object IsNot Nothing Then
Label1.Invoke(Sub() Label1.Text = f.Object)
End If
End Sub)
End Sub
End Class
How can I solve this issue
Thank you in advance
2 answers
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
-
Yusuf-3141 50 Reputation points
2024-10-20T23:35:24.6+00:00