SunainaDG
SunainaDG

Reputation: 109

How to send data from Xamarin Froms to IoTHub using Amqp protocol

I have a Xamarin Forms PCL mobile App. I want to send data from my device to the Azure IoTHub using Amqp Protocol. But just this code is not helping because

deviceClient = DeviceClient.Create(HostName, new DeviceAuthenticationWithRegistrySymmetricKey(DeviceId, DeviceKey), TransportType.Amqp);

I tried using Http1 but with Http the issue I'm facing is my app is supposed to continuously send data and recieve data from the iot hub. Like in 2 secs intervals. So after say a certain 1 hr maybe my iot hub reaches the throttling limit since Http is meant for infrequent calls.

And all my devices stop recieving any data.

Btw I have been using Microsoft.Azure.Devices.Client.PCL nuget package.

Which (I just found out) supports only Http.

UPDATE: We dont need Microsoft.Azure.Devices.Client.PCL anymore for Xamarin PCL applications.

We can use the Microsoft.Azure.Devices.Client nuget package in our Xamarin PCL project. But make sure like any other PCL package you do not start adding this package to each of your platform. Just install it in your PCL project and you are good to go.

Upvotes: 0

Views: 312

Answers (1)

Rita Han
Rita Han

Reputation: 9700

Btw I have been using Microsoft.Azure.Devices.Client.PCL nuget package.

Which (I just found out) supports only Http.

Yes, currently, Microsoft.Azure.Devices.Client.PCL only supported HTTPS protocol.

For using AMQP on android(not PCL), there is a new package can help. You can check this issue.

Upvotes: 1

Related Questions