Push Notification Api

フリーミアム
よって TeamsDevBot | 更新済み 1ヶ月前 | Advertising
Health Check

N/A

README


> ~~## How to setup frontend web app too which your visitors will subscribe?
~~


- [ ] **Steps**

1. Add SW.js file to your public folder.
2. Add these code in header app.
`<script>
        navigator.serviceWorker.register("sw.js");

        function enableNotif() {
            Notification.requestPermission().then((permission)=> {
                if (permission === 'granted') {
                    // get service worker
                    navigator.serviceWorker.ready.then((sw)=> {
                        // subscribe
                        sw.pushManager.subscribe({
                            userVisibleOnly: true,
                            applicationServerKey: "these code will generate for you"
                        }).then((subscription)=> {
                            console.log(JSON.stringify(subscription));
                         
                        });
                    });
                }
            });
        }
    </script>`







フォロワー:0
API作成者:
Rapid account: Teams Dev Bot
TeamsDevBot
teamsdevbot
評価APIにログイン
評価:5-投票:1