mobilusoss/react-web-notification
소개
React component with HTML5 Web Notification API
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalReact-web-notification

React component with HTML5 Web Notification API.
This component show nothing in dom element, but trigger HTML5 Web Notification API with render method in the life cycle of React.js.
Demo
Installation
npm install --save react-web-notification
API
Notification
React component which wrap web-notification.
Props
Notification.propTypes = {
ignore: bool,
disableActiveWindow: bool,
askAgain: bool,
notSupported: func,
onPermissionGranted: func,
onPermissionDenied: func,
onShow: func,
onClick: func,
onClose: func,
onError: func,
timeout: number,
title: string.isRequired,
options: object,
swRegistration: object,
};
ignore: if true, nothing will be happendisableActiveWindow: if true, nothing will be happen when window is activeaskAgain: if true,window.Notification.requestPermissionwill be called oncomponentDidMount, even if it was denied before,notSupported(): Called when HTML5 Web Notification API is not supported.onPermissionGranted(): Called when permission granted.onPermissionDenied(): Called when permission denied.Notificationwill do nothing until permission granted again.onShow(e, tag): Called when Desktop notification is shown.onClick(e, tag): Called when Desktop notification is clicked.onClose(e, tag): Called when Desktop notification is closed.onError(e, tag): Called when Desktop notification happen error.timeout: milli sec to close notification automatically. Ignored if0or less. (Default5000)title: Notification title.options: Notification options. setbody,tag,iconhere. See also (https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)swRegistration: ServiceWorkerRegistration. Use this prop to delegate the notification creation to a service worker. See also (https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification) ⚠️onShow,onClick,onCloseandonErrorhandlers won't work when notification is created by the service worker.
Usage example
See example
yarn
yarn run start:example
Tests
yarn test
Update dependencies
Known Issues
- Notification.sound
Notification.soundis not supported in any browser. You can emulate it withonShowcallback. see example.
License
관련 프로젝트 살펴보기
불러오는 중…