如何订阅多个Pusher公共频道?

时间:2016-03-27 09:32:33

标签: ios swift pusherswift

订阅频道的默认方法包括调用客户端对象的subscribe方法:

pusher.subscribe('my-channel')

我有一系列频道,例如['my-channel','test-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

1 个答案:

答案 0 :(得分:0)

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

GitHub issue link