HTTP v1 API: “click_action” for webpush notification

后端 未结 4 607
北海茫月
北海茫月 2021-01-23 16:42

Documentation in FCM focuses heavily on Android/iOS and my lowly webpush self is struggling with click_action.

click_action was a

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-23 17:28

    You can include whatever key=>value pairs you want within the data field of your Web Push payload.

    Register a notificationclick event listener in your service worker and these data values are available within the event triggered when your notification is clicked. Access your data, then execute your desired click action.

提交回复
热议问题