The default method for subscribing to a channel involves invoking the subscribe method of your client object:
pusher.subscribe('my-channel')
I have an array of channels e.g ['my-channel', 'test-channel']. The events will be generated in any of the channels and i need to listen from each of them.
// 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"])
}
But there is an error:
Contextual type 'String' cannot be used with array literal