[B4X] Supabase - The Open Source Firebase alternative
Supabase is an open source Firebase alternative. It provides all the backend services you need to build a product. Supabase uses Postgres database with real-time capabilities. Basically, supabase provides an interface to manage postgres database that you can use to create table and insert, edit...
www.b4x.com
This is a very simple tutorial on how to use the Realtime module. A more detailed tutorial is coming soon.
Step 1
Click in your project on "Project -> Build configurations -> Conditional Symbols"
Put
SupabaseRealTime
and click okStep 2
Check in the libraries tab the following libs.:
B4A: WebSocket
B4I: iWebSocket
B4J: jWebSocketClient V2.0+
Step 3
Initialize the SupabaseRealtime class
B4X:
Sub Class_Globals
Public xSupabase As Supabase
Private Realtime As SupabaseRealtime
End Sub
#IF B4J
Private Sub xlbl_Connect2Realtime_Click_MouseClicked (EventData As MouseEvent)
#Else
Private Sub xlbl_Connect2Realtime_Click
#End If
Wait For (xSupabase.Auth.isUserLoggedIn) Complete (isLoggedIn As Boolean)
If isLoggedIn = False Then
Wait For (xSupabase.Auth.LogIn_EmailPassword("test@gmail.com","Test123!!")) Complete (User As SupabaseUser)
If User.Error.Success Then
Log("successfully logged in with " & User.Email)
Else
Log("Error: " & User.Error.ErrorMessage)
Return
End If
End If
'********Realtime part************************
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")
End Sub
Supabase provides a globally distributed cluster of Realtime servers that enable the following functionality:
[B4X] Supabase - Realtime Postgres Changes
https://www.b4x.com/android/forum/threads/b4x-supabase-the-open-source-firebase-alternative.149855/ Listen to Postgres changes using Supabase Realtime. https://supabase.com/docs/guides/realtime/postgres-changes Setup https://www.b4x.com/android/forum/threads/b4x-supabase-realtime.156354/...
www.b4x.com
[B4X] Supabase - Realtime Broadcast
https://www.b4x.com/android/forum/threads/b4x-supabase-the-open-source-firebase-alternative.149855/ Send and receive messages using Realtime Broadcast https://supabase.com/docs/guides/realtime/broadcast Setup https://www.b4x.com/android/forum/threads/b4x-supabase-realtime.156354/ Listening to...
www.b4x.com
[B4X] Supabase - Realtime Presence
https://www.b4x.com/android/forum/threads/b4x-supabase-the-open-source-firebase-alternative.149855/ Share state between users with Realtime Presence. https://supabase.com/docs/guides/realtime/presence Setup https://www.b4x.com/android/forum/threads/b4x-supabase-realtime.156354/ Sync and track...
www.b4x.com
Supabase Dashboard
You need to turn on the realtime feature for each table, a description can be found here:
Attachments
Last edited: