-
Notifications
You must be signed in to change notification settings - Fork 13
Remove Starscream Dependency and bump minimum support platform #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
so using this demo bazel example branch - this line spits out the build I drag across - the branch I have is using a local supabase swift files in repo (I did that to get around crash before in other ticket) -also helps so I don't need to push to git / tag / publish release I generate xcode project ./xcodegen app I do a clean on xcode to make sure realtime frameworks are flushed but I'm afraid - no changes are showing when I add a row of data. EDIT I set a breakpoint for on changes - but nothing hits Correction - Just confirming this is definitely your pull request code that's been built. I'm seeing the heart beat -
private var client:SupabaseClient?
var database:PostgrestClient?
var realtimeClient:RealtimeClient?
private let supabaseUrl = "https://1234.supabase.co"
private let supabaseKey = "1234.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBxeGN4bHR3b2lmbXhjbWhnaHpmIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjAxODczNDQsImV4cCI6MTk3NTc2MzM0NH0.NiufAQmZ3Oy7eP7wNWF-tvH-e2D-UIz-vPLpLAyDMow"
struct TestClass: Codable {
var id: Int?
}
var allUsersUpdateChanges:Realtime.Channel?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let rootVC = storyboard.instantiateInitialViewController()
self.window?.rootViewController = rootVC
self.window?.makeKeyAndVisible()
let rt = RealtimeClient(endPoint: "https://1234.supabase.co/realtime/v1", params: ["apikey": supabaseKey])
rt.connect()
rt.onOpen {
self.allUsersUpdateChanges = rt.channel(.all)//rt.channel(.table("test", schema: "public"))
self.allUsersUpdateChanges?.on(.all) { message in
print("☕️")
print(message.payload)
print(message.event)
print(message.status)
}
self.allUsersUpdateChanges?.subscribe()
}
self.realtimeClient = rt
self.realtimeClient?.onError{error in
print("🔥 error")
print(error)
}
self.realtimeClient?.onMessage{message in
print("🔖 message")
print(message.payload)
print(message.event)
print(message.status)
// print(message.joinRef)
}
// allUsersUpdateChanges.unsubscribe()
// allUsersUpdateChanges.off(.update)
let client = SupabaseClient(supabaseURL:URL(string: supabaseUrl)!, supabaseKey: supabaseKey)
let database = PostgrestClient(url: "\(supabaseUrl)/rest/v1", headers: ["apikey":supabaseKey], schema: "public")
//
self.client = client
self.database = database
//
self.database?.from("test").select().execute() { result in
switch result {
case let .success(response):
do {
let feedback = try response.decoded(to: [TestClass].self)
print(feedback)
} catch {
print(error.localizedDescription)
}
case let .failure(error):
print(error.localizedDescription)
}
}
//
return true
} I pushed updates to So either the server is not correctly sending the update down the wire - or the update is sent - but it's not being received correctly. I can attach Charles debugger and see if I can inspect traffic. |
so - I https://github.com/supabase/realtime-js clone this - use my instance var socket = new RealtimeClient("https://1234.supabase.co/realtime/v1", { params: { apikey: "1234.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBxeGN4bHR3b2lmbXhjbWhnaHpmIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjAxODczNDQsImV4cCI6MTk3NTc2MzM0NH0.NiufAQmZ3Oy7eP7wNWF-tvH-e2D-UIz-vPLpLAyDMow" }}) it connects fine - but I don't see updates coming down .... This instance was shut down / paused by Ant. - Not sure if that's causing this problem. @GRSouza - I'm seeing traffic on realtime in dashboard - not sure why I don't get the notification on insert |
So this working for me. |
This PR bumps the minimum supported platforms to:
That make's it possible to remove the
Starscream
dependency.