Push notifications using jQuery JavaScriptany plugin - Stack Overflow

Push notifications using jQuery JavaScriptany plugin.I have a service that will return data as follows

Push notifications using jQuery JavaScript/any plugin.

I have a service that will return data as follows:- 

Error_Id, Description, DateTime, Etc.

Need to display these fields and it should also contain two buttons i.e. Accept & Reject.

On click of accept/reject button should call another service.

Tried jQuery notifications, but it does not work like browser notifications apis. When browser is minimized it will all minimize.

Tried browser notifications but could not add two custom buttons.

Ref link:-

Also referring the below link it clearly mentions cannot add buttons:- Desktop Notification with HTML Markup ( code example )?

Any help shall be greatly appreciated. Thanks!

Push notifications using jQuery JavaScript/any plugin.

I have a service that will return data as follows:- 

Error_Id, Description, DateTime, Etc.

Need to display these fields and it should also contain two buttons i.e. Accept & Reject.

On click of accept/reject button should call another service.

Tried jQuery notifications, but it does not work like browser notifications apis. When browser is minimized it will all minimize.

Tried browser notifications but could not add two custom buttons.

Ref link:- https://web-push-book.gauntface./chapter-05/02-display-a-notification/#title-and-body-options

Also referring the below link it clearly mentions cannot add buttons:- Desktop Notification with HTML Markup ( code example )?

Any help shall be greatly appreciated. Thanks!

Share Improve this question edited Jan 10, 2020 at 11:08 Dev asked Jan 10, 2020 at 10:42 DevDev 4106 silver badges23 bronze badges 2
  • What you have tried, please show us the code which is not working – Amanjot Commented Jan 10, 2020 at 10:46
  • I've updated 2 links containing ref code and another stating cannot add buttons. – Dev Commented Jan 10, 2020 at 11:09
Add a ment  | 

1 Answer 1

Reset to default 4

Use Link for add push notification in web application.

function notifyMe() {
  // Let's check if the browser supports notifications
  if (!("Notification" in window)) {
    alert("This browser does not support desktop notification");
  }

  // Let's check whether notification permissions have already been granted
  else if (Notification.permission === "granted") {
    // If it's okay let's create a notification
    var notification = new Notification("Hi there!");
  }

  // Otherwise, we need to ask the user for permission
  else if (Notification.permission !== "denied") {
    Notification.requestPermission().then(function (permission) {
      // If the user accepts, let's create a notification
      if (permission === "granted") {
        var notification = new Notification("Hi there!");
      }
    });
  }

  // At last, if the user has denied notifications, and you 
  // want to be respectful there is no need to bother them any more.
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744743380a4591161.html

相关推荐

  • Push notifications using jQuery JavaScriptany plugin - Stack Overflow

    Push notifications using jQuery JavaScriptany plugin.I have a service that will return data as follows

    7天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信