简体   繁体   中英

Desktop Notification Not Working in Converse.js 5.0.1

I am setting up a server, the server is a Centos 7 + Apache machine, I downloaded converse.js and called "css" and "js" through the CDN provided by them, where i just did the Download and put inside my folders ( css , js ) but I am trying to use the notification, because sometimes I need to be notified of new messages when I have Browser minimized for example.

I tried using the documentation to put the following option inside Initialize: show_desktop_notifications: true, but it didn't work .

<html class="no-js" lang="en">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>Chat.Kmk</title>


    <noscript><p><img src="//stats.opkode.com/piwik.php?idsite=5" style="border:0;" alt="" /></p></noscript>
    <link type="text/css" rel="stylesheet" href="css/converse.min.css" />
    <script src="js/libsignal-protocol.min.js"></script>
    <script src="js/converse.min.js"></script>

</head>
<body class="converse-fullscreen">
<div id="conversejs-bg"></div>
<script>
 converse.initialize({


        authentication: 'login',
        auto_away: 300,
        auto_reconnect: true,
        bosh_service_url: 'http://chat.xxx.xxx:7070/http-bind/', // Please use this connection manager only for testing purposes
        message_archiving: 'always',
        view_mode: 'fullscreen',
        allow_contact_removal:false,
        allow_contact_requests:false,
        show_chat_state_notifications:true,
        show_desktop_notifications:true,
        show_chat_state_notifications:'online',
        notify_all_room_messages:true

    });
</script>
</body>
</html>

I minimized the browser, opened another one, sent a message, but no notifications were displayed.

i had this problem too, but in my case the notification worked on some outdated mozilla browsers, i believe chrome only allow if the source is HTTPS, today i can get notification of converse.js in chrome after placing a certificate SSL on Apache.

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM