An example code for implementing desktop reminder function using HTML5

零下一度
Release: 2017-04-22 14:37:54
Original
2594 people have browsed it

Introduction to Desktop Reminder

The desktop notification function allows the browser to notify users of messages even when it is minimized. This is the most natural combination with WebIM. However, the only browser that currently supports the Desktop Notification function is Chrome 5+. In the actual use process, the interference of the notification function to the user should be minimized and the occurrence of the notification function should be minimized. This requires solving the following problems:

  • 1. Receive When receiving multiple messages, ensure that only one notification appears;

  • 2. When the user is on the page where IM appears (the page is in Focus state), no notification will appear;

  • 3. When the user uses multiple tabs to open multiple pages with IM, as long as one page is in the Focus state, no notification will appear;

  • 4. How Let users click on the notification floating layer to locate the specific chat window

  • 5. In addition, a convenience issue also needs to be solved

Desktop Reminder Notification API

window.webkitNotifications

  • ##requestPermission Request communication permission

  • checkPermission Check communication permission

  • createNotification Create communication

  • show ## To achieve

       Creating OS notifications in HTML5 
          
    Copy after login

    , students who need to learn html5 please pay attention to the php Chinese website
  • html5 video tutorial
. Many html5 online video tutorials can be watched for free!

The above is the detailed content of An example code for implementing desktop reminder function using HTML5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!