We can create plugin that do not need to call Plugin.Init() to each plaform.. #313
Replies: 12 comments
-
What problem would it solve? Except add a new useless black box that will make a lot of problem. |
Beta Was this translation helpful? Give feedback.
-
It will make it easier for people to use the framework. Even if you have experience with XAML/C#/ the .NET ecosystem, this whole plugin initialization system is something quite unique to Xamarin. In all other frameworks, you add the package and then you just use it. In Xamarin, no, you first need to go to some file - in the happy case it's just Removing this requirement for the developers, makes it easier for people new to the framework to onboard / get going using existing knowledge, without needing to know quirks for even the simplest of plugins. |
Beta Was this translation helpful? Give feedback.
-
Today, on the XF project you don't need the Update |
Beta Was this translation helpful? Give feedback.
-
Glad to hear that, I must admit I don't have much experience on the plugin development side and my experience as an app developer with almost - if not all - plugins is that you need to make some sort of initialization call. Not sure if the plugin developers are just lazy (for the lack of a better word) or it's some sort of limitations they are hitting. Just to give one example - FFImageLoading - in their Xamarin.Forms getting started guide, in Step 2 they have you add |
Beta Was this translation helpful? Give feedback.
-
Not that I know for certain, but the If MAUI offers a |
Beta Was this translation helpful? Give feedback.
-
@REscobar with .net 5 there are module initializers. |
Beta Was this translation helpful? Give feedback.
-
Thanks good to know, somehow that escaped me. I can see that some plugins may opt to initialize that way, but I think that there will be scenarios where that is not possible, like requiring a reference to some application context. Just to be clear, having to call an Is MAUI getting a |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@nextcodelab and if the plugin needs to do a custom initialization? Like an |
Beta Was this translation helpful? Give feedback.
-
Remember that the concepts of plugins as they are in Flutter doesn't exist in Xamarin or Maui. |
Beta Was this translation helpful? Give feedback.
-
I think it is not necessary to invent something new but just use Module Initializers of C # 9.0. |
Beta Was this translation helpful? Give feedback.
-
Call Global Context
|
Beta Was this translation helpful? Give feedback.
-
in xamarin form we need to call pluginsInit() in app start.. I hope Maui.net the user do not need to write it app start Init PlugIn(). like flutter it automatically generate Init plugins when building by tools...
Beta Was this translation helpful? Give feedback.
All reactions