Posts

Showing posts with the label push-notification

Web push notification showing multiple times for multiple opened tabs

Web push notification showing multiple times for multiple opened tabs I've added web push notifications in my web app; in master layout (asp.net MVC) (using signalR). $(function () { // Declare a proxy to reference the hub. var notifications = $.connection.notificationHub; //debugger; // Create a function that the hub can call to broadcast messages. notifications.client.updateMessages = function () { getMeetingNotifications() }; // Start the connection. $.connection.hub.start().done(function () { // alert("connection started") getMeetingNotifications(); }).fail(function (e) { alert(e); }); }); If there are multiple tabs open for the same application. It pushes multiple notifications for the same activity. I resolved this by adding a tag field. function getMeetingNotifications() { $.ajax({ url: '@Url.Action("Index", "Home")', cache: false, type...

react-native-fcm don't receive notification when app is opened

react-native-fcm don't receive notification when app is opened Why can't i receive notication from react-native-fcm when the app is opened? Here is my payload const proState={}; proState.notiUID=recKey; proState.notiPayload={ data: { senderKey:senderKey, id: senderKey+':chat', type: 'chat' }, notification: { title: proState.senderSnap.fullname, body: proState.lastmsg, sound: 'default', id: senderKey+':chat', tag : senderKey+':chat', priority : "high", data: senderKey }, }; const optionss = { priority: "high", show_in_foreground: true }; return admin.messaging() .sendToTopic(proState.notiUID, proState.notiPayload,optionss) I only receives notifications when the app is minimized or closed 1 Answe...