SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
Web Notification
전용우
알림
• 기존의 알림 방식은 마크업으로 레이어를 보여주는 방식
• 브라우저에서 제공해주는 알림 API을 이용
• 좀 더 쉽게 개발자는 알림 기능을 사용할 수 있음
• 브라우저 마다 동작하는 방식은 제각각
만약, 알림을 계속 준다면?
• 반드시 사용자에게 알림을 받을지 승인을 받고 적용.
• 사용자 이벤트로만 호출 가능.
Notification.requestPermission(function(grant) {
// default : 설정하지 않음
// denied : 거부
// granted : 허락
});
!
Notification.permission; //현재 권한 상태 확인
var noti = new Notification(
"title",//필수
{//옵션
"body" :"body", //내용.
"icon" : "icon.png", //아이콘
"tag" : "group" //tag가 같으면 알람으로 표현
}
);
알림을 주자!
사용자 이벤트
이벤트명 발생 시점
show 알림이 보여질 때
close 알림이 닫혔을 때(close메서드 사용)
click 알림을 클릭했을 때(알림이 닫힘)
error 에러가 발생했을 때
noti.addEventListener(“show”,function(){…});
메서드
메서드명 기능
close 알람을 닫음
noti.close();
버그인듯, 버그아닌, 버그같은 너
• 알림을 클릭하면 알림이 닫히고 click이벤트가 발생함.
• 그럼 close이벤트가 발생하는게 맞는가?
• 일반적으론 발생하지 않지만 firefox os는 close이벤트
가 발생
• show이벤트의 발생시점?
• Notification을 생성하는 것만으로 알림이 나타남.
• 이벤트를 attach하기 전에 알림이 나타나지만, show이
벤트는 발생.
감사합니다.

Contenu connexe

Similaire à Web notification

Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)
Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)
Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)Wonseok Jang
 
2013 11 unity3 d integration google play game services(남경수)
2013 11 unity3 d integration google play game services(남경수)2013 11 unity3 d integration google play game services(남경수)
2013 11 unity3 d integration google play game services(남경수)경수 남
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]WSConf.
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Appsjungkees
 
PWA 파헤치기
PWA 파헤치기PWA 파헤치기
PWA 파헤치기SangHun Lee
 
Scouter Tutorial & Sprint
Scouter Tutorial & SprintScouter Tutorial & Sprint
Scouter Tutorial & SprintGunHee Lee
 
5-5. html5 connectivity
5-5. html5 connectivity5-5. html5 connectivity
5-5. html5 connectivityJinKyoungHeo
 
Flipper 불완전 정복
Flipper 불완전 정복Flipper 불완전 정복
Flipper 불완전 정복Sewon Ann
 
[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1igaworks
 
[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1성인 김
 
[Osx dev] server essential lesson 11. managing with profile manager
[Osx dev] server essential   lesson 11. managing with profile manager[Osx dev] server essential   lesson 11. managing with profile manager
[Osx dev] server essential lesson 11. managing with profile managerEungShik (Henry) Kim
 

Similaire à Web notification (15)

Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)
Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)
Progressive Web App(PWA) 테코톡 발표자료 - 마르코(장원석)
 
Eclipse RCP 1/2
Eclipse RCP 1/2Eclipse RCP 1/2
Eclipse RCP 1/2
 
2013 11 unity3 d integration google play game services(남경수)
2013 11 unity3 d integration google play game services(남경수)2013 11 unity3 d integration google play game services(남경수)
2013 11 unity3 d integration google play game services(남경수)
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
iOS9 소개
iOS9 소개iOS9 소개
iOS9 소개
 
PWA 파헤치기
PWA 파헤치기PWA 파헤치기
PWA 파헤치기
 
Scouter Tutorial & Sprint
Scouter Tutorial & SprintScouter Tutorial & Sprint
Scouter Tutorial & Sprint
 
jhj port.
jhj port.jhj port.
jhj port.
 
5-5. html5 connectivity
5-5. html5 connectivity5-5. html5 connectivity
5-5. html5 connectivity
 
Flipper 불완전 정복
Flipper 불완전 정복Flipper 불완전 정복
Flipper 불완전 정복
 
Active MQ
Active MQActive MQ
Active MQ
 
[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1
 
[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1[Iga works] live operation in app notice guide-1.1
[Iga works] live operation in app notice guide-1.1
 
[Osx dev] server essential lesson 11. managing with profile manager
[Osx dev] server essential   lesson 11. managing with profile manager[Osx dev] server essential   lesson 11. managing with profile manager
[Osx dev] server essential lesson 11. managing with profile manager
 

Plus de yongwoo Jeon

EcmaScript6(2015) Overview
EcmaScript6(2015) OverviewEcmaScript6(2015) Overview
EcmaScript6(2015) Overviewyongwoo Jeon
 
Web Components 101 polymer & brick
Web Components 101 polymer & brickWeb Components 101 polymer & brick
Web Components 101 polymer & brickyongwoo Jeon
 
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지yongwoo Jeon
 
모바일 디버깅
모바일 디버깅모바일 디버깅
모바일 디버깅yongwoo Jeon
 

Plus de yongwoo Jeon (12)

EcmaScript6(2015) Overview
EcmaScript6(2015) OverviewEcmaScript6(2015) Overview
EcmaScript6(2015) Overview
 
Web Components 101 polymer & brick
Web Components 101 polymer & brickWeb Components 101 polymer & brick
Web Components 101 polymer & brick
 
asm.js
asm.jsasm.js
asm.js
 
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
모바일 디버깅
모바일 디버깅모바일 디버깅
모바일 디버깅
 
Web component
Web componentWeb component
Web component
 
Html5 use cases
Html5 use casesHtml5 use cases
Html5 use cases
 
Html5 performance
Html5 performanceHtml5 performance
Html5 performance
 
Devfest
DevfestDevfest
Devfest
 
Scriptable cache
Scriptable cacheScriptable cache
Scriptable cache
 
Whats jindo
Whats jindoWhats jindo
Whats jindo
 

Web notification

  • 3. • 기존의 알림 방식은 마크업으로 레이어를 보여주는 방식 • 브라우저에서 제공해주는 알림 API을 이용 • 좀 더 쉽게 개발자는 알림 기능을 사용할 수 있음 • 브라우저 마다 동작하는 방식은 제각각
  • 4. 만약, 알림을 계속 준다면? • 반드시 사용자에게 알림을 받을지 승인을 받고 적용. • 사용자 이벤트로만 호출 가능. Notification.requestPermission(function(grant) { // default : 설정하지 않음 // denied : 거부 // granted : 허락 }); ! Notification.permission; //현재 권한 상태 확인
  • 5. var noti = new Notification( "title",//필수 {//옵션 "body" :"body", //내용. "icon" : "icon.png", //아이콘 "tag" : "group" //tag가 같으면 알람으로 표현 } ); 알림을 주자!
  • 6. 사용자 이벤트 이벤트명 발생 시점 show 알림이 보여질 때 close 알림이 닫혔을 때(close메서드 사용) click 알림을 클릭했을 때(알림이 닫힘) error 에러가 발생했을 때 noti.addEventListener(“show”,function(){…});
  • 8. 버그인듯, 버그아닌, 버그같은 너 • 알림을 클릭하면 알림이 닫히고 click이벤트가 발생함. • 그럼 close이벤트가 발생하는게 맞는가? • 일반적으론 발생하지 않지만 firefox os는 close이벤트 가 발생 • show이벤트의 발생시점? • Notification을 생성하는 것만으로 알림이 나타남. • 이벤트를 attach하기 전에 알림이 나타나지만, show이 벤트는 발생.