09-27-2019 04:19
09-27-2019 04:19
Hi all,
i am developing an application for iOS and Android which communicate with Fitbit Companion App via socket as it was recommended. We developed it for Android which is working fine, data passing both side.
But in iOS integration we are facing issue like we receive the ping/ Connection request but after accepting the connection message transferring is not working. When we try to read data from socket on iOS app we receive nothing.
So can anybody suggest with some library name or code for iOS or Fitbit so that these can communicate.
Here is some code in Swift:
func readNewData(){
print("reading once again")
var readData = Data()
do{
//let stringRead = try socket.readString()
let bytesRead = try listenSocket?.read(into: &readData) ?? 0//socket.read(into: &readData)
if bytesRead > 0 {
guard let response = String(data: readData, encoding: .utf8) else {
print("Error decoding response...")
return
//break
}
print("data string read in socket are \(response)")
}
}catch let error{
print("error reading data in socket \(error) and \(error.localizedDescription)")
}
}
Thanks in advance 😊.
12-10-2020 11:44
12-10-2020 11:44
Hi @Jaideep824
I think your questions belongs in the SDK forums. I've moved your post and someone here should be able to help.
Gordon