Writing a Wrapper Library around Native iOS and Android Libraries?

I'm writing a wrapper library around an existing native iOS and Android Library for reuse across my Xamarin forms apps. I created a solution with a Portable Class Library, Android library, Android binding, iOS library and iOS binding projects. I tried to use Dependency service in the main PCL project to resolve the platform specific implementation classes inside my Android and iOS library projects. However, the Dependency Service always returns null. The implementation classes in the Android library and iOS library projects have the Assembly decoration. I tried adding a manual Register call in the test Xamarin forms app that uses this library. It seems to work when Debugging the app. However, in release mode the dependency service always returns null. Am I on the right path here in creating the wrapper library. Should I be using an IOC such as Ninject to do this service resolution instead of Xamarin.Forms.Dependency?

Xamarin.Android version 6.1
Xamarin.iOS version 9.8
Visual Studio 2015

Sign In or Register to comment.