Client.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler()) not working when offline


In Xamarin.IOS I found that Azure mobile app in offline mode wouldnt get past this line when offline.

await MobileService.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler())

And if you remove the await and put a Wait at the end that just causes deadlock.

Only solution I found that works is:

System.Threading.Tasks.Task.Run(() => MobileService.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler())).Wait();

This is as per Quickstarts sample so clearly they need to update it.