angular service-worker - handling push notification click

前端 未结 3 1888
再見小時候
再見小時候 2021-01-11 18:37

How do I handle the push notification click in angular service worker. The SWPush does not have any methods.

I have tried referencing a js which listens to the \"no

3条回答
  •  情深已故
    2021-01-11 19:29

    I had to update my package.json to:

    "@angular/service-worker": "7.1.0"

    then this worked for me:

    this.swPush.notificationClicks.subscribe((result) => {
          console.log('clicked', result);
        });
    

提交回复
热议问题