-
Is anyone using this library with Unity? Any thoughts/suggestions? One thing I would find very useful is the ability to use the new signInWithIdToken / signInWithApple functionality. I found this in the gotrue-dart, a C# version would be very nice. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I've been messing around with it in Godot - particularly the gotrue-csharp functionality. I haven't used it in Unity, a previous dev said that he had struggled getting realtime-csharp working with the Unity compiler, but I'm not sure what all he tried. This project (https://github.com/eliyap/supabase-unity) was working previously, but is on an old version. Still a little behind getting all the LW7 functionality worked in. The code is in gotrue-csharp if you want to submit a PR! They're always welcome. |
Beta Was this translation helpful? Give feedback.
-
I got it working in Unity, at least basic connection to a Hello World PostREST JS function pretty easily.
I then added a button and a text field and wired them up to this script, and everything seems to be working fine. I added an FPS checker and a spinning cube and the async seems to be working properly. I'll dig into the native auth stuff and see if I can sort out a PR. The dart version looks like it has the basics, I'll play around and see what I can sort out. As an aside, I've been thinking about switching to Godot but TBH I just wasted a bunch of time on Flutter and finally gave up and went back to Unity. Maybe for my next project... :) using System.Collections.Generic;
using System.Threading.Tasks;
using Postgrest.Responses;
using Supabase;
using TMPro;
using UnityEngine;
public class SupabaseStuff : MonoBehaviour {
private string SupabaseURL = "https://[projectid].supabase.co";
private string SupabasePublicKey =
"[SUPABASE_PUBLIC_KEY]";
public TMP_Text result;
private static Client _supabase;
private async void StartSupabase() {
string url = SupabaseURL;
string key = SupabasePublicKey;
if (_supabase == null) {
_supabase = new Client(url, key);
await _supabase.InitializeAsync();
}
Dictionary<string, object> param = new Dictionary<string, object>();
param["name"] = "howdy";
Task<BaseResponse> rpc = _supabase.Rpc("hello_js_as_json", param);
await rpc;
if (rpc.IsCompleted) {
result.text = rpc.Result.Content;
} else {
result.text = $"{rpc.Status}";
}
}
public void StartPublic() {
result.text = "...";
StartSupabase();
}
} |
Beta Was this translation helpful? Give feedback.
I got it working in Unity, at least basic connection to a Hello World PostREST JS function pretty easily.
I then added a button and a text field and wired them up to this script, and everything seems to be working fine. I added an FPS checker and a spinning cube and the async seems to be working properly.
I'll dig into the native auth stuff and see if I can sort out a PR. The dart version looks like it has the basics, I'll play around and see what I can sort out.
As an aside, I've been thinking about switching to Godot but TBH I just wasted a bunch of time on Flutter…