Hi,
we encountered a problem with Aiden and Massimo with the underlying architecture of the multiplatform project in Xamarin.
We need to have Auth service module accessible from application. But module has some platform specific implementations we need to get.
1) Suppose we have some class
Auth implementing
IServiceModule. We would have it implemented only using platform-independent. So we can simply do
MobileCore.Instance.GetInstance<Auth>()
2) But now we need to have some platform specific stuff done in the module, so we create
AuthAndroid and AuthIOS extending Auth (which is now abstract) in platform specific projects.In ordinary pure Android (or iOS respectively) app we can do:
MobileCore.Instance.GetInstance<AuthAndroid>()
3) But we can't do that with Xamarin.Forms app where stuff is in platform independent project.
We can utilize
DependencyService in Xamarin.Forms app project or create separate Xamarin.Forms project with Auth, but it seems that code won't be very pretty in this case.
What can we do to solve this problem?
I think we can debate it further after todays ST1 standup.
--