ios - 如何订阅多个 Pusher 公共(public) channel ?

标签 ios swift pusherswift

订阅 channel 的默认方法涉及调用客户端对象的订阅方法:

pusher.subscribe('my-channel')

我有一系列 channel ,例如 ['my-channel', 'test-channel']。这些事件将在任何 channel 中生成,我需要从每个 channel 中收听。

// Class properties
let pusher = Pusher(key: Config.Constant.pusherAppKey)
var myChannel:PusherChannel?

override func viewDidAppear(animated: Bool) {
    // PUSHER CONNECT?SUBSCRIBE
    self.pusher.connect()
    self.myChannel = self.pusher.subscribe(["temp_testing_channel", "all_test_channels"])
}

但是有一个错误:

Contextual type 'String' cannot be used with array literal

最佳答案

目前此功能不可用。正如作者所说。这是链接

GitHub issue link

关于ios - 如何订阅多个 Pusher 公共(public) channel ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36245857/

相关文章:

ios - 使用 TileJSON 的 Mapbox 源在 iOS 上导致问题

ios - MPNowPlayingInfoPropertyElapsedPlaybackTime 设置不正确

objective-c - 如何使用回调函数访问 runAction 的目标?

ios - Xcode "Missing Submodule"警告

ios - 推送客户端错误 : Invalid Signature

ios - Pusher 聊天工具包教程未按预期工作

iOS 共享扩展 URLForResource 访问主应用程序中的文件

swift - 素数 Swift 3

swift - NSFileManager 文件存在于路径 :isDirectory and swift