Hello,
The issue is that the fingerprint sensor code can be reached before the required platform initialization.Is there a recommended approach to solving this issue?
You can add your code of initialization to the MauiProgram.cs
and wrap the Conditional compilation for Platform-specific code like the following code.
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
#if ANDROID
// execute your android init code
#elif IOS
// execute your iOS init code
#else
// execute other platform init code
#endif
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
}) ;
return builder.Build();
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.