8 Answer(s)
-
0
Hi @devinedon When I publish a test notification, it increases the notification number on the badge and alerts without the need to refresh the page.
I could not reproduce it. Can you please share a video screenshot or a gif that show the problem. Or you can send a demo project that contains that problem to [email protected].
-
0
Thanks for putting this together! Really appreciate it. Will see if it does this for default notifications such as new user registrations etc... Will get back to you ASAP
EDIT: Even new users registering dont show.. but strangly they dont even show in the Notifications page? Should they? "On a new user registered to the application." It is written to AbpNotifications
-
0
Hi @devinedon
Yes, it should work like that for default notifications as well. Do you have any javascript error on browser console ?
-
0
Hey,
If it means anything, the chat works perfectly. Pushes through perfectly.
Is it not problematic that Im triggering the push from a 3rd party application (Azure Function CosmosDB trigger)?
using (var obj = Startup.iocManager.ResolveAsDisposable<AzFunctionAbpExecuter>()) { await obj.Object.AddNewDeviceEventAppNotifier(deviceData); }
public class AzFunctionAbpExecuter : ITransientDependency { private readonly IRepository<Tenant> _tenantRepository; private readonly IAppNotifier _appNotifier; public AzFunctionAbpExecuter(IRepository<Tenant> tenantRepository, IAppNotifier appNotifier) { _tenantRepository = tenantRepository; _appNotifier = appNotifier; } public async Task AddNewDeviceEventAppNotifier(SynapWare.CosmosDB.DeviceData data) { await _appNotifier.NewDeviceEventAsync(data); } }
public async Task NewDeviceEventAsync(DeviceData deviceData) { var notificationData = new LocalizableMessageNotificationData( new LocalizableString( "NewDeviceEventNotificationMessage", SynapWareConsts.LocalizationSourceName ) ); notificationData["deviceSerial"] = deviceData.Serial; if (deviceData.aimEventData != null) { notificationData["eventType"] = deviceData.aimEventData.deviceEventDataType.ToString(); } UserIdentifier user = new UserIdentifier(null, userId: 1); await _notificationPublisher.PublishAsync(AppNotificationNames.NewDeviceEvent, notificationData, userIds: new[] { user }); }
-
0
Hi,
Is it not problematic that Im triggering the push from a 3rd party application (Azure Function CosmosDB trigger)?
Yes, this is the reason :)
AspNet Zero's SignalR connection will not be aware of this request. In order to make this work, you can try Azure signalR Service.
-
0
Thanks, I see from https://support.aspnetzero.com/QA/Questions/9129/Signal-R-send-custom-messages-to-Client-Side-using-azure-functionBlob-Triggered you say its supported from 8.6 and up. Is there any documentation to help me get going faster from ANZ?
-
0
So making progress - web host is changed to use Azure Signal R and all looks good
However, how would I access IApplicationbuilder in Azure Functions in order to map the endpoint (if you know of course). Could I get it via AbpModule? Just code below showing how you guys do it in an ASPNET Core application
app.UseEndpoints(endpoints => { endpoints.MapHub<AbpCommonHub>(AppConsts.SignalRAbpCommonHubPath); }
A host error has occurred during startup operation '39caf9b3-b3fa-472c-a351-6cc74d272ece'. [2020-12-14T11:48:02.356Z] func: Invalid host services. Microsoft.Azure.WebJobs.Script.WebHost: The following service registrations did not match the expected services: [2020-12-14T11:48:02.358Z] [Invalid] ServiceType: Microsoft.Extensions.Hosting.IHostedService, Lifetime: Singleton, ImplementationType: Microsoft.Azure.SignalR.HeartBeat, Microsoft.Azure.SignalR, Version=1.6.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60. Value cannot be null. (Parameter 'provider')
-
0
Hi,
If you follow https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-dotnet-core, you can enable Azure SignalR service in AspNet Zero.