Unsubscribe channel not working on socketcluster.
I have to subscribe 20 channel. Now I want unsubscribe 10 channel. So We are use below code for subscribe.
// For subscribe
SoketManager.client.subscribeAck(channelName:"random") { (str, obj1, obj2) in
print ("Got data for channel", str)
}
// Listening to channel
SoketManager.client.onChannel(channelName:"random", ack: {
(channelName : String , data : AnyObject?) in
print ("Got data for channel", channelName, " object data is ", data ?? "")
})
We are use below code for unsubscribe.
// For unsubscribe
SoketManager.client.unsubscribeAck(channelName:"random", ack : {
(channelName : String, error : AnyObject?, data : AnyObject?) in
if (error is NSNull) {
print("Successfully unsubscribed to channel ", channelName)
} else {
print("Got error while unsubscribing ", error ?? "")
}
})
When I am call "unsubscribeAck" method always get error. Here is error.
{
message = "Failed to unsubscribe socket from the [object Object] channel - Socket YFaGYE5Tbu1_8we2AAAG tried to unsubscribe from an invalid channel name";
name = BrokerError;
}
Also I am trying with socketcluster demo as well but It not working for me.
Github link: https://github.com/sacOO7/socketcluster-client-swift
Appreciate your help.
Thanks