This package contains the AppCenter plugin for MvvmCross


Keywords
maui, xamarin, android, ios, appcenter, mvvmcross
License
MIT
Install
Install-Package MvvX.Plugins.AppCenter -Version 2022.10119.0-preview-5

Documentation

MvvX.AppCenter

Use AppCenter SDK on a MvvmCross application (https://www.mvvmcross.com/).

Why using a plugin as AppCenter is compatible with .net standard ? With a plugin, you can use an interface (IAppCenterClient) in order to use AppCenter functions

=========

IC

Quality Gate Status .NET NuGet package

Onboarding Instructions

Installation

  1. Add nuget package:

    Install-Package MvvX.Plugins.AppCenter

  2. In App.xaml.cs file add the following line in usage declaration section:

    MvvX.Plugins.AppCenter;
  3. In App.xaml.cs file add the following line in App class constructor:

    var appCenterClientId = "Set AppCenter Id here";
    var buildVersion = "Set your application build version here"; 
    // ex : Assembly.GetExecutingAssembly().GetName().Version.ToString()
    var appCenterClient = Mvx.Resolve<IAppCenterClient>();
    appCenterClient.Configure(appCenterClientId, 
                                buildVersion,
                                true,
                                true,
                                true,
                                null,
                                null);

Attach file at each crash report

You can define a default file that will be attached to an Exception report when an exception occured in the application. To do it, set the full file path in the Configure method

    var fileToUploadSamplePath = "c:\file.log";
    var appCenterClient = Mvx.Resolve<IAppCenterClient>();
    appCenterClient.Configure(appCenterClientId, 
                                buildVersion,
                                true,
                                true,
                                true,
                                fileToUploadSamplePath,
                                null);

In this example, when a crash occured, the file "c:\file.log" will be attached to the exception report.

Attach additional file at each crash report

Sometimes you need to attach more than a unique log file.

For this case, you can define additional file path to the Configure method. All files defined here will be zipped and attached to an Exception report when an exception occured in the application.

    var otherfile1 = "c:\temp\otherFile.log";
    var otherfile2 = "c:\temp\otherFile2.log";
    var appCenterClient = Mvx.Resolve<IAppCenterClient>();
    appCenterClient.Configure(appCenterClientId, 
                                buildVersion,
                                true,
                                true,
                                true,
                                null,
                                new List<string>()
                                {
                                    otherfile1,
                                    otherfile2
                                });

In this example, when a crash occured, a zipped file (named "AdditionalContent.zip") will be attached to the exception report.

Support / Contribute

If you have any questions, problems or suggestions, create an issue or fork the project and create a Pull Request.