Closed Ugarz closed 6 years ago
If you're just using a string then it will get interpreted as a device_iden
(unless it contains @
in which case it'll be treated as an email). If you want to push to a channel you have to be more explicit:
Give this a try:
pusher.link({ channel_tag: 'insert-tag-here' }, 'GitHub', 'https://github.com/', function(error, response) {}
You can see the logic at https://github.com/alexwhitman/node-pushbullet-api/blob/master/lib/internal/pushes.js#L129
Thank you for your response ! I finally managed to do it 👍 but I didn't found it in the readme, I'd like to contribute adding it to the documentation if you're okay :)
FYI here's my new code wich has been a bit reduced haha 😀
/**
* pushNotification
*
* @param {string} query
* @returns
*/
function pushNotification(query) {
const slugifiedQuery = slugify(query)
const link = `http://aprettysite.com/${slugifiedQuery}.html`;
return pusher.link({ channel_tag: process.env.REACT_APP_PUSH_CHANNEL }, 'Ask for something ' + query, link);
}
Thanks for you time and your help, this lib' rox !
It's kind of mentioned via the last item on https://github.com/alexwhitman/node-pushbullet-api/blob/master/README.md#target-devices but it could be clearer.
Closing the issue as I managed to do what I want, thanks for your help !
Hello,
I'm using this lib' to push datas to specific persons for a while. Now we are a lot more and I decided to give a try to push into a channel. I tried with postman without trouble but I can't find in the readme how to push in a damn channel. Could anyone help me to find out ?
Here is my error
I know that pusher.link() is to push a link to someone, but I can't find for a channel.
Thanks a lot :)