locked
IOT with Xamarin form RRS feed

  • Question

  • Good day,

    I tried to use Microsoft.Azure.Device.Client nuget in my xamarin form (android) application but 
    it keeps on waiting forever on this method (await deviceClient.SendEventAsync(message);but when I use console application it works fine can you please help.

    publicasync Task<string> Send(object telemetryDataPoint) { try { deviceClient = DeviceClient.Create(iotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey("raspberrypi3", deviceKey), TransportType.Mqtt); var messageString = JsonConvert.SerializeObject(telemetryDataPoint); var message = new Message(Encoding.ASCII.GetBytes(messageString)); await deviceClient.SendEventAsync(message); var Test = string.Format("{0} > Sending message: {1}", DateTime.Now, messageString); } catch (Exception exception) { throw exception; } return"Testing"; }

    Friday, August 2, 2019 6:29 AM

All replies

  • Hello Friend,

    This forum is for Windows IoT Core support. You issue seems not relative with Windows IoT Core. For better support, it is recommended to move this topic to Azure IoT Hub forum.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 2, 2019 8:06 AM
  •  

    Hi please use this sample application as a reference if you haven't yet: 

    https://github.com/Azure/azure-iot-sdk-csharp/tree/master/iothub/device/samples/XamarinSample

    You can also file issues at the same repo:  https://github.com/Azure/azure-iot-sdk-csharp/issues if you want to have IoT C# SDK development team to directly look at the issue

    Saturday, August 3, 2019 1:00 AM
  • Was my previous suggestion useful?
    Wednesday, August 7, 2019 12:47 AM