Closed rromanchuk closed 5 years ago
Thanks for your questions!
Faye.Client.config = .init(url: URL(string: "wss://faye.getstream.io/faye")!)
let notificationChannelName = "site-\(client.appId)-feed-\(feedId.together)"
let channel = Channel(notificationChannelName, client: Client.fayeClient) { [weak self] data in
// Parse data here.
}
channel.ext = ["api_key": client.apiKey, "signature": client.token, "user_id": notificationChannelName]
do { try Client.fayeClient.subscribe(to: channel) } catch { // Handle errors here. }
// Keep the subscription object, until you need it and then set it to nil. var subscription: SubscribedChannel? = SubscribedChannel(channel)
It's from the current implementation: https://github.com/GetStream/stream-swift/blob/master/Sources/Faye/Feed%2BFaye.swift
If you'll have other questions, let me know.
@buh thanks! this is perfect
Looks like there may have been some drift, as signatures and return types have changed and the following snippet won't compile.
https://github.com/GetStream/stream-swift/wiki/Realtime-updates
Do you have any recent usage snippets? I've poked around the source but I might be missing something. Is it possible to just get these message payloads without needing to conform to an activity type? Also, are there any low level connection reference documentation (so I can avoid digging through the sdks) for real time? Since my scope is very narrow i'd prefer to establish these sockets myself in exchange for the users jwt token.
I'll dig into the sdks, but if you have any hints would be great. It might even make more sense for me to create a new channel between my own client/server socket and just push out those messages myself when I get them upstream from my firehose.