Sync App

What do you use to let user sync data with your app ? With flutter I implement Firebase, for iOS / macOS native APP I use iCloudKit / CoreData.

What do you use with Xojo App? mobile and desktop

Supabase, can’t recommend it enough!

1 Like

I make some tests with Supabase, it looks cool. Do you use it with Xojo? Is it working fine?

Can’t recommend it enough… it’s incredible! We have an app with a few thousand daily users, works like a charm. With up too thousand users logged on at the same time, we use it for instant messaging, notification updates, we also have a large set of functions. Pricing is more than fair… it’s simply the way to go!

A screenshot of one of the features. Users can create groups (a collective name for n many documents) and set their privacy / assign moderators / admins / contributors / editor etc. as well as various sharing and visibility settings. It’s a breeze to maintain post update changes and to notify all subscribed users of post updates.

image

We used Xojo for Mac / Win versions but Dart / Flutter for App.

We thoroughly reviewed hundreds of posts for Xojo in regards to custom controls but we found so much to be completely out-dated, so a set of 24 controls were developed (including a Supabase server class, I can share the skeleton of it) that all follow the same layout approach (allowing for App skinning), as well as assigning to a central preference class / localization class (all stored in Supabase). User messages (first time messages etc. / which messages user has seen are also stored in Supabase).

It took 2,5 years to develop of which I would say 40% went to by-pass out-dated controls / working with known xojo issues. After the UI control kit was in place (written from scratch) the development is a breeze. I just wished there was a large offering of custom control kits out there for Xojo.

Speaking of controls (and sorry for my blablabla)… we even developed a textfield input as both textarea control and textfield control in Xojo are a total nightmare and XAML containers recently introduced, are anything except cross-platform.

An important aspect of the approach was to NOT use image files for icons, but vectors.

Here is an example of a control behaves, everything is defined in the IDE (What the preference value is, what label constant to use, which vector (glyph, which is defined in the preference class)

En example of the textfields, all data synced to Supabase in real time, using custom controls which are all defined in IDE, so the entire page, storage of data / error handling / error messages is all defined in the IDE for this particular page, no code.

image

So… Supabase is the way to go, the rest of the post was just me blowing out some steam due to the lack of 3rd party controls out there for Xojo.

2 Likes

Thank you for your contribution. Do you know where can I found tutorials or sample code to use Supabase for login to a db, upload file, query a database?

I can send you sample code (class)

Auth and upload file are very easy, i recommend youtube / chatgpt or supabase tutorials (found within supabase) for that. But for use of functions, querying, using views etc i can send you a class

it will be nice thanks

PM info?

That is interesting , do they have an api for XOJO or some modules ? or you did all that to integrate those ? I assume that all is cloud based .

Thanks

Had to develop it from scratch. Wasn’t that hard… but what we have now is a modern-looking-responsive application that makes the most of Supabase… and again, I highly recommend it to Xojo developers. Very cheap and the free tire gets you up and running (for free) until you are a mid-sized company with a significant workload and users.

Basic connection example to a Supabase DB using URLConnection component

// SUPABASE_APIKEY = a constant storing your Supabase ApiKey 
URLServer.RequestHeader("apikey") = SUPABASE_APIKEY
URLServer.RequestHeader("Authorization") = "Bearer " + SUPABASE_APIKEY

// Set data (JSON) 
var oJSON as new JSONItem

// Set  and define your JSON data (oJSON)

// Set the request content, set mime type to json string
// NOTE : K_APPJSON is a constant string, it's value : "application/json"
URLServer.SetRequestContent(oJSON.ToString, K_APPJSON)

// Send Sync request to server
// Note : K_SERVER : Your Supabase URL : https://uniquestringhere.supabase.co/rest/v1/
// Note : K_TIMEOUT : Integer timeout value 
UrlServer.Send("PUT",K_SERVER + "users?id=eq." + iUserID.ToString,K_TIMEOUT)

The Supabase API key looks something like this :

faspdf9f34pchhbsdh4hprefy0fehcfhfyygHphfgeorHHhf473urejnht6y7fruhiscdj&)/UIhbsdh4hprefy0fehcfhfyygHphfgeorHHhf473urejnht6y7fruhiscdj&)/UIhbsdh4hprefy0fehcfhfyygHphfgeorHHhf473urejnht6y7fruhiscdj&)/UI

Note that when using Supabase views / functions / Edge functions etc. the URL (in the sample above the constant K_SERVER) changes a little bit. For general table access you use :

https://youruniquestring.supabase.co/rest/v1/

Following that base URL constant, you add your view / function name / select statement or what it might be, so you end up with

https://youruniquestring.supabase.co/rest/v1/tablenamehere?SelectStatement

May i ask: Why not Dart/Flutter for Desktop, too, then? Not ready for Desktop?

Pros : Endless amount of amazing widgets that make your app stand-out. Truly cross platform. Huge user base. Single codebase.

Cons : Huge size of applications. Not exactly resource friendly (CPU / memory etc.)

1 Like