[aerogear-dev] [help needed] AG Xamarin multiplatform service module problem

Vojtech Sazel vsazel at redhat.com
Fri Apr 20 08:59:25 EDT 2018


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.

-- 

VOJTĚCH SÁZEL

SENIOR SOFTWARE ENGINEER, RED HAT MOBILE

Red Hat

<https://www.redhat.com/>

Remote Czech Republic

vsazel at redhat.com    IM: vsazel
<https://red.ht/sig>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20180420/cc6a5b7e/attachment.html 


More information about the aerogear-dev mailing list