Hi,
I'm currently working on a Xamarin Forms app for iOS (published)/Android (published)/WinRT (soon to be published) using the App42 SDK for Xamarin2.0.
When testing on an iPhone 6S (iOS 10) or on a Moto X (Android M) in airplane mode, I get an unhandled exception from the App42 library that leads to a fatal crash of the app, which is definitely a show stopper. From the stacktrace, you can see that it is thrown from a thread that is owned by App42's library, over which I have no control. AFAIK, I can't catch and handle that exception.
A possible workaround would be to test for connectivity before calling any of App42's methods, but that exception (or a different one?) might still be thown if, for example, connectivity is lost between the test and the effective call... Best practice tells us to catch the exception on App42's side and pass it around through the error callback of the FindAllDocuments method.
Any idea how to remedy to the situation?
The Xamarin SDK I'm using (2.0) seems to be quite old (december 2015), is there a more recent/stable version around?
You'll find the details of the exception below.
--------------------------------------------------------------------------------------------------
Unhandled Exception:
System.Net.WebException: Error: NameResolutionFailure
at com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorAsync.ExecuteGet (System.String url, System.Collections.Generic.Dictionary`2[TKey,TValue] paramsDics, System.Collections.Generic.Dictionary`2[TKey,TValue] headerParams) [0x000fa] in <e5033534dee042a4a22cdb500c3247c1>:0
at com.shephertz.app42.paas.sdk.csharp.storage.StorageService.FindAllDocuments (System.String dbName, System.String collectionName) [0x000c4] in <e5033534dee042a4a22cdb500c3247c1>:0
at com.shephertz.app42.paas.sdk.csharp.storage.StorageService+<>c__DisplayClass7.<FindAllDocuments>b__6 () [0x00000] in <e5033534dee042a4a22cdb500c3247c1>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/thread.cs:68
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:893
at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/thread.cs:105
--------------------------------------------------------------------------------------------------
Best regards,
Jonathan