Azure-Samples/MyDriving

Xamarin app - store backend connection strings in .config to make more discoverable

nicolehaugen opened this issue · 3 comments

We've gotten several questions about where the backend connection strings are stored in the Xamarin app in the scenario where the user wants to setup their own backend using the scripts we provide. We currently store these connection strings directly in the code which makes them hard to find and it also requires the app to be recompiled if they are changed. To make this entire scenario easier, we should be storing these connection strings in a .config file.

Could they just be in a .cs file that we point to such as all the hockey app stuff?

now it's in:
AzureClient.cs
DeviceProvisionHandler.cs
Logger.cs
please move it to one file i.e. config.cs - IMHO can be hardcoded, app.config functionality to change values during runtime like for win/web app is not needed ...

What needs to be configured on the MobileApp to connect to the service app? I ran the deploy script and that seems to work. However, no data is being stored to the Cloud nor does the IoT hub see my device. I entered my service app url in AzureClient.cs, the IoTHub connection string in Device ProvisionHandler.cs and the Hockey app ID in Logger. I also started the stream analytics jobs and configured the Facebook login. Anything else?