Pushwoosh / web-push-notifications

Web Push Notifications
Other
62 stars 28 forks source link

browser notification click url #11

Closed superainovacoes closed 6 years ago

superainovacoes commented 8 years ago

Hi, in the docs we cant set the click url for the browser notification.

We want to set differents urls for each notification.

example:

notification 1 - token A - chrome_url = somesite1.com notification 2 - token B - chrome url = somesite1.com/foo notification 3 = token C - chrome url = somesite1.com/foo/bar

In developer words, we are asking for a "chrome_url"/"firefox_url"/"safari_url" parameters to change the click url destionation for each notification.

https://community.pushwoosh.com/questions/3766/browser-notification-click-url

grandecomplex commented 7 years ago

This is a requirement. Can we get a date for this feature otherwise I'm afraid we'll have to move off?

synth commented 7 years ago

+1 what's the status of this?

shaders commented 7 years ago

the work is in progress, I'll update on Monday

wfhm commented 7 years ago

Hi,

Will the following workaround cover your needs?

https://community.pushwoosh.com/questions/3766/browser-notification-click-url

synth commented 7 years ago

The post you link to references a link to some JSONP example, but if you follow the link, it leads to a 404 page

viridanti commented 7 years ago

Sorry, updated the link. Here it is:

JSON request example

wfhm commented 6 years ago

You can use the "chrome_root_params" (or safari/firefox) object with "l" or "link" key to pass a custom link:

{
    "request": {
        "application": "APPLICATION_CODE",
        "auth": "API_ACCESS_TOKEN",
        "notifications": [{
            "send_date": "now", // YYYY-MM-DD HH:mm  OR 'now'
            "ignore_user_timezone": true, // or false
            "content": "Hello world!",
            "link": "https://pushwoosh.com", //default link
            "chrome_root_params":{"link":"https://google.com"}, //custom Chrome link
            "safari_root_params":{"link":"https://apple.com"}, //custom Safari link
            "firefox_root_params":{"link":"https://mozilla.org"}, //custom Firefox link
        }]
    }
}
ipehimanshu commented 3 years ago

ok and using which event we can trace like we need to open link in new tab or stay user in same window ? @wfhm can you help us Thanks