Azure-Samples/MyDriving

connecting my Xamarin IoS app to MY azure backend

arturoqu opened this issue · 4 comments

OK, so I deployed the back end using the scripts, thank you for that.

After obtaining my APPLE DEVELOPER account, I managed to compile and deploy the IOS application in XAMARIN to my IPHONE, the application works well, connects to my OBD device, and tracks my trips.

How do I connect my IOS application to my Azure backend?

What steps do I follow, where in the code do I enter the connection strings?

I have read all the GITHUB and Reference architecture docs, I can't find that info anywhere. In many places in the doc it says "go here for that info", but it is not there...

I undertand that I will have to re-compile my app with the hardocoded info about the connection to the back end, once I find out where to enter that info, but need guidance on this.

The more details, the better.

Thanks in advanced

AQ

Thanks you, I had found the first reference on my own, and modified it, and it seemed to work...

I will follow your advice and modify both places.

Thank you so much.

BTW, you have al done a superb job with this solution......iMHO the documentation should have this little tidbit reflected in it, also the piece about enabling the sign in options of the mobile app.

Alina, thank you. I have made the two changes you indicated above...I am making progress....

Now, the IoS device registers in the Azure IoT HUB, and I can see data in the Azure DB (dbo.trips table), but no messages make it to the Azure IoT HUB,

Azure IoT hub indicates 1 device is registered (my IPhone) but no messages, is there anything else I need to change?

Thanks.

Try debugging the mobile app to see if data is uploaded successfully to IoT Hub. You can put breakpoints in the following places:

CurrentTripViewModel.cs
obdDataProcessor.SendTripPointToIOTHub(CurrentTrip.Id, CurrentTrip.UserId, point);

OBDDataProcessor.cs

try
{
await iotHub.SendEvent(packagedBlob);
}
catch (Exception e)
{
//An exception will be thrown if the data isn't received by the IOT Hub; store data in buffer and try again
Logger.Instance.Track("Unable to send data to IOT Hub: " + e.Message);
AddTripPointToBuffer(packagedBlob);
}