-
-
Save cionman/44a2f1560cf916f4129d777f53f896b7 to your computer and use it in GitHub Desktop.
서비스워커 등록
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/** | |
* Dom 로딩 후 동작 | |
*/ | |
document.addEventListener('DOMContentLoaded', function() { | |
//...생략 | |
if(navigator.serviceWorker){ | |
navigator.serviceWorker.register('/firebase-messaging-sw.js') | |
.then(function(reg){console.log('서비스워커 등록성공 :', reg)}) | |
.catch(function(error){console.log('서비스워커 등록실패 :', error)}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment