首页 > 解决方案 > 直接深度链接到特定的聊天或消息?

问题描述

这适用于 iOS:当我有频道 ID 和/或消息 ID 时,您建议使用什么方法从应用程序的其他地方直接深度链接到特定聊天或消息?

标签: iosgetstream-io

解决方案


我们建议使用query函数通过 id 获取消息/频道。

// Fetch a channel by id
let query = ChannelsQuery(filter: .key("id", .equal(to: "channel-id")))
Client.shared.channels(query: query).subscribe(onNext: { (response) in
    // handle response
}).disposed(by: disposeBag)

// Fetch a message by id
Client.shared.message(with: "message-id").subscribe(onNext: { (response) in
    // handle response
}).disposed(by: disposeBag)

很快我们将发布 2.0,它将支持通常的回调方式。


推荐阅读