github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/notify/webpush.md (about)

     1  
     2  ---
     3  title: "Push уведомления"
     4  linkTitle: "webpush"
     5  date: 2022-06-08
     6  description: >
     7  
     8  ---
     9  
    10  Web push notifications are short messages that Smart Home sends to the browser to convey important information. They are displayed even to users who have left the website and do not require email or phone number input.
    11  
    12  ### Configuration:
    13  * Public Key
    14  * Private Key
    15  
    16  ### Attributes:
    17  * userIDS
    18  * title
    19  * body
    20  
    21  ### JavaScript Properties:
    22  
    23  ----------------
    24  
    25  ### New Message
    26  
    27  Creates a message object
    28  
    29  ```coffeescript
    30  msg = notifr.newMessage();
    31  msg.type = 'webpush';
    32  msg.attributes = {
    33    'userIDS': '14',
    34    'title': 'Lorem Ipsum is simply',
    35    'body': 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum'
    36  };
    37  
    38  ```
    39  | Value | Description |
    40  |-------|-------------|
    41  | newMessage() | Method |
    42  | msg | Type: Object (Message) |
    43  
    44  ----------------
    45  
    46  ### Code Example:
    47  
    48  ```coffeescript
    49  # webpush
    50  # ##################################
    51  sendMsg =()->
    52    msg = notifr.newMessage();
    53    msg.type = 'webpush';
    54    msg.attributes = {
    55      'userIDS': '14',
    56      'title': 'Lorem Ipsum is simply',
    57      'body': 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum'
    58    };
    59    notifr.send(msg);
    60  
    61  sendMsg()
    62  ```
    63