Component check list

Whenever I start a project it happens to me that some of the added Nuget don't work like they should, most often because I forgot some initialization. As a aid to memory I want to collect here the necessary stept you need to do to get a component working.

If you have more components that need special handling, please add a comment and I will add them to the page.

 

Acr.UserDialogs

Has also to be added to all platform projects

Android:

UserDialogs.Init(this);
OR UserDialogs.Init(() => provide your own top level activity provider)
OR MvvmCross - UserDialogs.Init(() => Mvx.Resolve<IMvxTopActivity>().Activity)
OR Xamarin.Forms - UserDialogs.Init(() => (Activity)Forms.Context)

iOS and Windows:

Nothing to do


FFImageLoading

Has also to be added to all platform projects

You must add this line to your platform specific project (AppDelegate.cs, MainActivity.cs, etc) before you use FFImageLoading:

CachedImageRenderer.Init();

HockeyApp

Has to be added to platform projects

You must add this line to your platform specific project (AppDelegate.cs, MainActivity.cs, etc)

Android:

CrashManager.Register(this, "YourAppID");

As default HockeyApp add android.permission.WRITE_EXTERNAL_STORAGE to your AndroidManifest.xml. You only need this if you want to use the inapp udate mechanism. Here is how to remove it.

iOS:

 var manager = BITHockeyManager.SharedHockeyManager;
 manager.Configure("bfaf091d8f524130b49aaa77cfc36485");
 manager.StartManager();

SlideOverKit

iOS:

 SlideOverKit.iOS.SlideOverKit.Init();
 var mc = new MenuContainerPageiOSRenderer();

The second line is necessary because somehow the iOS linker removes otherwise the renderer. Strangely if you deploy to a iPhone5 it works without that.


XamSVG

Be sure to add this lines in the Assembly  that contains the SVG images as embedded resources (here the Assembly that contains the App class):

var assembly = typeof(App).GetTypeInfo().Assembly;
XamSvg.Shared.Config.ResourceAssembly = assembly;

iOS:

 SvgImageRenderer.InitializeForms();

 

Leave a Reply

Your email address will not be published. Required fields are marked *