Azure Mobile App Services sets you up with a nice template builds all of your boiler plate code. When I went through the setup on the Azure Portal and downloaded the template locally I ran into all sorts of issues with iOS not working in my Xamarin.Forms project. Everything appears to work without issue on Android but I couldn’t get the MobileServiceClient to load, the app would just crash. After lots of digging and playing with the tools provided I figured out what was wrong. It appears the template was missing some platform specific code for iOS.

Make sure you properly initialize it in the iOS specific project in the AppDelegate.cs. Add the folowing snippet prior to launching the app.

New Code:

1
CurrentPlatform.Init();

Example AppDelegate.cs

1
2
3
4
5
6
7
8
9
10
11
12
13
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        global::Xamarin.Forms.Forms.Init();
        // new code to properly initialize iOS for Azure
	CurrentPlatform.Init();
        LoadApplication(new App());

        return base.FinishedLaunching(app, options);
    }
}

Your Xamarin app should now be working with your Azure App Services.