Firebase teszthez
This commit is contained in:
@@ -12,7 +12,12 @@ using Microsoft.Maui.Hosting;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using WorkFlowCheck.MAUI.Handlers;
|
||||
using WorkFlowCheck.MAUI.Helper;
|
||||
using Plugin.Firebase.CloudMessaging;
|
||||
using Microsoft.Maui.LifecycleEvents;
|
||||
|
||||
#if ANDROID
|
||||
using Plugin.Firebase.Core.Platforms.Android;
|
||||
#endif
|
||||
namespace WorkFlowCheck.MAUI
|
||||
{
|
||||
public static class MauiProgram
|
||||
@@ -23,7 +28,7 @@ namespace WorkFlowCheck.MAUI
|
||||
builder.UseDevExpress(useLocalization: false)
|
||||
.UseDevExpressControls()
|
||||
.UseDevExpressCollectionView();
|
||||
|
||||
|
||||
builder.Services.AddAutoMapper(typeof(MapperProfile));
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddDbContext<AppDbContext>();
|
||||
@@ -46,7 +51,7 @@ namespace WorkFlowCheck.MAUI
|
||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||
fonts.AddFont("FontAwesome.ttf", "FontAwesome");
|
||||
})
|
||||
|
||||
.RegisterFirebaseServices()
|
||||
.UseMauiCommunityToolkitCore()
|
||||
.UseMauiCommunityToolkit();
|
||||
#if DEBUG
|
||||
@@ -63,11 +68,24 @@ namespace WorkFlowCheck.MAUI
|
||||
}).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
|
||||
ServiceProvider = app.Services;
|
||||
return app;
|
||||
}
|
||||
|
||||
public static IServiceProvider ServiceProvider { get; private set; }
|
||||
|
||||
|
||||
|
||||
private static MauiAppBuilder RegisterFirebaseServices(this MauiAppBuilder builder)
|
||||
{
|
||||
builder.ConfigureLifecycleEvents(events =>
|
||||
{
|
||||
#if ANDROID
|
||||
events.AddAndroid(android => android.OnCreate((activity, _) =>
|
||||
CrossFirebase.Initialize(activity)));
|
||||
#endif
|
||||
});
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user