Realtime.Initialize(Me,"Realtime",xSupabase) 'Initializes the realtime class
Realtime.Connect 'Connect to the supabase realtime server
Wait For Realtime_Connected 'Client is connected
Log("Realtime_Connected")
'Subscribe to all database changes on dt_Chat with room_id = 3
Realtime _
.Channel("public","dt_Chat","") _
.On(Realtime.SubscribeType_PostgresChanges) _
.Event(Realtime.Event_ALL) _
.Subscribe
Wait For Realtime_Subscribed 'Successfully subscribed
Log("Subscribed to topic")
End Sub
Private Sub Realtime_DataReceived(Data As SupabaseRealtime_Data)
Log("working ?")
If Data.EventType = Realtime.Event_UPDATE Then 'A record in the database was changed
For Each k As String In Data.Records.Keys
Log($"Column: "${k}" Value: "${Data.Records.Get(k)}""$)
Next
End If
End Sub