Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created November 4, 2017 13:00
Show Gist options
  • Select an option

  • Save webmaxru/28c96ae12b6eb05d92bf8df68bdf264f to your computer and use it in GitHub Desktop.

Select an option

Save webmaxru/28c96ae12b6eb05d92bf8df68bdf264f to your computer and use it in GitHub Desktop.
Notification payload format expected by NGSW from the backend
{
"notification": {
"title": "Ranjeet Kumar",
"actions": [
{
"action": "opentweet",
"title": "Open tweet"
}
],
"body": "The latest The Top Javascript Blogs Daily! https://t.co/o3PSNkk9Di Thanks to @LifeWithKathy #makeyourownlane",
"dir": "auto",
"icon": "https://pbs.twimg.com/profile_images/854195961085734917/0X7AFONJ_normal.jpg",
"badge": "https://pbs.twimg.com/profile_images/854195961085734917/0X7AFONJ_normal.jpg",
"lang": "en",
"renotify": true,
"requireInteraction": true,
"tag": 926796012340920300,
"vibrate": [
300,
100,
400
],
"data": {
"url": "https://twitter.com/statuses/926796012340920321",
"created_at": "Sat Nov 04 12:59:23 +0000 2017",
"favorite_count": 0,
"retweet_count": 0
}
}
}
@ramprakashSeepana

ramprakashSeepana commented Jun 20, 2018

Copy link
Copy Markdown

What does actions.action represents? what are the different option values for the action?

@ramprakashSeepana

Copy link
Copy Markdown

I have successfully sent the notifications, but when I click on the notifications it is unable to redirect the page. I have given my url in data.url But it is not able to redirect to that page. Do I need to change anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment