I have tried using both HTTP and MQTT to connect to IBM IOT platform from an ios device running a Xamarin application with no luck so far.
Right now I'm using the OPENNETCF MQTT package to connect using MQTT, but it seems stuck on "Connecting". I don't see any change to the device status while looking at the IOT Platform website.
My code to connect looks like this:
public async Task ConnectOpenNETCF() {
if (mclient == null) {
mclient = new MQTTClient("orgid.messaging.internetofthings.ibmcloud.com", 8883);
string id = "d:orgid:ios:test01";
await mclient.ConnectAsync(id, "use-token-auth", "the generated token");
if (mclient.IsConnected)
Console.WriteLine("Client is connected.");
else
Console.WriteLine("Client is not connected. " + mclient.ConnectionState);
} else {
Console.WriteLine("Status: " + mclient.ConnectionState);
}
}
Where orgid is the 6 character organization id that IOT platform generated, ios is the device type, and test01 is the device name. Am I doing something incorrectly? Where can I get more information besides the ConnectionState of the MQTT client?