This could help: <a class="postlink" href="http://docs.hangfire.io/en/latest/configuration/using-dashboard.html">http://docs.hangfire.io/en/latest/confi ... board.html</a>
It says, with ASP.NET Core, you can create a new class that implements IDashboardAuthorizationFilter. Inside that code you can check on permissions I believe to see if you can access or not.
Hello @ismcagdas,
The notifications are sent down to the user correctly using both toastr and Desktop notification. The only problem is that they don't appear in the header notification bar as new notifications because it seems they are not being stored in the DB.
Is there any configuration needed to allow notifications to be stored in the DB?
The code below to retrieve user works fine and I am able to get the user object and also showing the Full Name and it works.
await _appNotifier.SendMessageAsync(user.ToUserIdentifier(), $"Testing HangFire {user.FullName}", Abp.Notifications.NotificationSeverity.Success);
The AbpUserNotifications is always not showing those notifications as they are not stored.
(I hard coded the value here because I couldn't get the user object from the AbpSession, it is always null for some reason)
Oh thanks a lot! I thought I need to download a new project template again. I will give this a try.
Thanks
You made sure the Web API is working fine and no problems with the logic / db access?
Hello I use the same project template.
The way I use it as follows: 1- Run the server-side application (in debug or not in debug doesn't matter) 2- Go to the angular app, on the command go to nswag folder and then type "refresh.bat" 3- The proxies should be generated now
One thing that happens to me is that, I am using VS Code, so every time I run refres.bat, I have to close VS Code and open it again. then I will be able to see all new and updated proxies.
Try it
HTH
Any assistance is appreciated. Thanks
Any assistance is appreciated. Thanks
Actually I noticed that the notifications are being received. But since I am running in Chrome, Chrome asked me to Allow/Block notifications. So now notifications are appearing as a desktop-popup rather than they appear in the header top-bar notification area. Even if I go to /app/notifications page, they are not stored there at all.
any idea?
Hello, I configure my app to run with HangFire. I can see a job being enqueued. The job is making use of the NotificationPublisher to send a notification to a specific user (testing purpose). The user is never receiving those notifications.
I debugged the code and it works fine.
I also checked the AbpTenantNotifications, it seems those notifications used are not added to the DB.
public class TestingHangFireDomainService : DrcAppDomainServiceBase, ITestingHangFireDomainService
{
private readonly IAppNotifier _appNotifier;
private readonly IUnitOfWorkManager _unitOfWorkManager;
private readonly UserManager _userManager;
public TestingHangFireDomainService(IAppNotifier appNotifier, UserManager userManager, IUnitOfWorkManager unitOfWorkManager)
{
_appNotifier = appNotifier;
_unitOfWorkManager = unitOfWorkManager;
_userManager = userManager;
}
public async Task NotifyUser()
{
using (_unitOfWorkManager.Begin())
{
var user = _userManager.Users.Where(u => u.Id == 2).FirstOrDefault();
await _appNotifier.SendMessageAsync(user.ToUserIdentifier(), "Testing HangFire", Abp.Notifications.NotificationSeverity.Info);
}
}
}
Hello gentlemen, I am also facing problem trying to configure Hangfire. It only worked after I add this line too:
JobStorage.Current = new SqlServerStorage(_appConfiguration.GetConnectionString("Default"));
I thought that was already configured when this line runs:
services.AddHangfire(config =>
{
config.UseSqlServerStorage(_appConfiguration.GetConnectionString("Default"));
});
Thanks