banditoth.MAUI.DeviceId
1.0.0
dotnet add package banditoth.MAUI.DeviceId --version 1.0.0
NuGet\Install-Package banditoth.MAUI.DeviceId -Version 1.0.0
<PackageReference Include="banditoth.MAUI.DeviceId" Version="1.0.0" />
paket add banditoth.MAUI.DeviceId --version 1.0.0
#r "nuget: banditoth.MAUI.DeviceId, 1.0.0"
// Install banditoth.MAUI.DeviceId as a Cake Addin
#addin nuget:?package=banditoth.MAUI.DeviceId&version=1.0.0
// Install banditoth.MAUI.DeviceId as a Cake Tool
#tool nuget:?package=banditoth.MAUI.DeviceId&version=1.0.0
banditoth's MAUI.Packages 🏝
A toolkit for .NET MAUI, containing useful stuff to ease development for MAUI applications.
Packages
Package name | NuGet status | Android | iOS | Windows | MacCatalyst | Tizen |
---|---|---|---|---|---|---|
banditoth.MAUI.Multilanguage | ✅ | ✅ | ✅ | ✅ | ✅ | |
banditoth.MAUI.DeviceId | ✅ | ✅ | ✅ | ✅ | ❌ | |
banditoth.MAUI.JailbreakDetector | ✅ | ✅ | ❌ | ❌ | ❌ | |
banditoth.MAUI.MVVM | ✅ | ✅ | ✅ | ✅ | ✅ |
banditoth.MAUI.DeviceId
Initalization
Initalize the plugin within your MauiProgram.cs
's CreateMauiApp
method. Use the .ConfigureDeviceIdProvider
extension method with the using banditoth.MAUI.DeviceId
;
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureDeviceIdProvider();
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
Usage
Use the code with by resolving an instance of IDeviceIdProvider
.
The GetDeviceId
method returns an unique device identifier. On Android it serves the data from AndroidId
, on iOS and MacCatalyst it uses the IdentifierForVendor
. Windows returns the GetSystemIdForPublisher().Id
as a string.
The GetInstallationId
method generates an unique identifier for the application, which will be stored until the application is being reinstalled, or the application's data being erased.
Product | Versions |
---|---|
.NET | net7.0 net7.0-android net7.0-android33.0 net7.0-ios net7.0-ios16.1 net7.0-maccatalyst net7.0-maccatalyst16.1 net7.0-macos net7.0-tvos net7.0-windows |
-
net7.0
- No dependencies.
-
net7.0-android33.0
- No dependencies.
-
net7.0-ios16.1
- No dependencies.
-
net7.0-maccatalyst16.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.