Xamarin: XLabs 2.0 iOS IGeolocator Woes

Having completed an Android app using Xamarin.Forms, I was tasked with making the iOS counterpart. Well it’s Xamarin so ‘write once, run everywhere’ right? Haha, ok sure.

This particular issue was pretty confusing but was related to changes in the XLabs breaking changes introduced in v2, in particular this inconspicuous line:

You will have to use DependencyService.Register<>() on your platforms packages to register XLabs Services.

Add this to your app delegate and you should be good to go:

DependencyService.Register<IGeolocator, Geolocator>();

There’s also this issue to watch out for too: https://github.com/XLabs/Xamarin-Forms-Labs/issues/657