I am using pubnub sdk for socket stuff. My problem is I want to send the data dictionary format with type any but while I am trying to do so the compiler is saying like: Value of protocol type 'Any' cannot conform to 'JSONCodable'; only struct/enum/class types can conform to protocols. If I am sending with same type data then it is allowing. So how can send the data in dictionary with type Any.
var params = [String : Any]()
params["isContinous"] = true
params["pressure"] = 1
params["reset"] = true
params["StrokeWidth"] = 11.0
pubnub.publish(channel: "ch:broadcastPoints", message: params) { result in
switch result {
case let .success(response):
print("Successful Publish Response: \(response)")
case let .failure(error):
print("Failed Publish Response: \(error.localizedDescription)")
}
}