-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update from upstream SwiftPhoenixClient #21
base: main
Are you sure you want to change the base?
Conversation
Looks great, could use this now! Any idea on when this will be merged / released? |
I tried using this version in my project, but the latest version of |
…initializers (#22) * remove endpoint parameter name underscore prefix * Revert "remove endpoint parameter name underscore prefix" This reverts commit 478c72e. * add deprecated initializer to RealtimeClient for compatibility * Revert "add deprecated initializer to RealtimeClient for compatibility" This reverts commit 6061152. * add deprecated initializer to RealtimeClient for compatibility with supabase-swift 0.3.0
…ata (#23) * fix fatal error passing in non supported types to JSONSerialization.data(withJsonObject:...) * add assertion for valid JSON object to encode function
Currently using latest from export type RealtimeChannelOptions = {
config: {
/**
* self option enables client to receive message it broadcast
* ack option instructs server to acknowledge that broadcast message was received
*/
broadcast?: { self?: boolean; ack?: boolean }
/**
* key option is used to track presence payload across clients
*/
presence?: { key?: string }
}
} Wondering if there should be some additional config type, automatic payload injection in Presence, or I should just add docs @GRSouza? let client = supabase.realtime
let params = [
"config": [
"presence": [
"key": profile.id
],
"broadcast": [
// "ack": true
"self": true
]
]
]
// let channel = client.channel(.table(id, schema: "someChannel") - presence.onSync will never call
let channel = client.channel(.table(id, schema: "someChannel"), params: params) // This works fine
let presence = Presence(channel: channel)
presence.onSync {
// Only calls if params are passed into channel
}
client.connect()
channel.join() |
@foodisbeast I think we should use the same approach and also add documentation |
What do you think about adding a string initializer to |
If we can't know all the possible events then it's fine to add a string initializer @foodisbeast |
* add ChannelOptions type and initializer * add default options to channel creation function * Add Presence sync docs * Update initializer parameter spacing in Sources/Realtime/Channel.swift Co-authored-by: Guilherme Souza <[email protected]> --------- Co-authored-by: Guilherme Souza <[email protected]>
…ptions optional. (#28)
What kind of change does this PR introduce?
Bug fix, feature, docs update, ...
What is the current behavior?
Please link any relevant issues here.
What is the new behavior?
Feel free to include screenshots if it includes visual changes.
Additional context
Add any other context or screenshots.