Skip to content

Kebechet/Maui.MicrosoftClarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Buy Me A Coffee"

Maui.MicrosoftClarity

NuGet Version NuGet Downloads

Wrapper for Microsoft Clarity for mobile

Usage

Firstly register package installer in your MauiProgram.cs

 builder.Services.AddMicrosoftClarity();

then in App.xaml.cs inject MicrosoftClarityService:

public partial class App : Application {
    private readonly MicrosoftClarityService _microsoftClarityService;

    public App(MicrosoftClarityService microsoftClarityService) {
        InitializeComponent();
        _microsoftClarityService = microsoftClarityService;
    }
}

and also override there method OnStart() to call _microsoftClarityService.Initialize with your project id.

protected override void OnStart() {
    _microsoftClarityService.Initialize("<MicrosoftClarityProjectIdHere>");

    base.OnStart();
}

⚠️ iOS Local debugging

Because of MAUI and VS bugs:

it is not possible to run your app with hot-restart(direct local iOS deploy from VS for Windows)

Dummy classes

So that you dont have to specify platform for this package and it's calls, also Windows and MacCatalyst are added with dummy implementations. When you call one of their methods you will always get:

  • true for bool returns
  • new List<> for collections
  • string.Empty for string values

Exception behavior

  • Library will throw exceptions only in case developer did some mistake
  • in other cases, when there is some corrupted state it will return default value of that type.

Contributions

Feel free to create an issue or pull request. In case you would like to do massive changes in the package please firstly discuss them in the issue because otherwise there is high chance that such big PR would be rejected.

License

This repository is licensed with the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published