You can send web notifications manually from the dashboard. You can also automate notification sending with the REST API or using one of the libraries. We also offer a Zapier app for RSS feeds and other integrations.
notification = Pushpad::Notification.new({
title: "Web Notification Example",
body: "Hello world!",
target_url: "https://example.com"
})
# deliver to specific users
notification.deliver_to ["user1", "user2"]
# deliver to segments
notification.broadcast tags: ['tag1', 'tag2']
# deliver to everyone
notification.broadcast
$notification = new Pushpad\Notification(array(
'title' => "Web Notification Example",
'body' => "Hello world!",
'target_url' => "https://example.com"
));
# deliver to specific users
$notification->deliver_to(["user1", "user2"]);
# deliver to segments
$notification->broadcast(["tags" => ["tag1", "tag2"]]);
# deliver to everyone
$notification->broadcast();
var pushpad = require('pushpad');
var project = new pushpad.Pushpad({ authToken: AUTH_TOKEN, projectId: PROJECT_ID });
var notification = new pushpad.Notification({
project: project,
title: 'Web Notification Example',
body: 'Hello world!',
targetUrl: 'https://example.com'
});
// deliver to specific users
notification.deliverTo(['user1', 'user2'], function(err, result) { /*...*/ });
// deliver to segments
notification.broadcast({ tags: ['tag1', 'tag2'] }, function (err, result) { /*...*/ });
// deliver to everyone
notification.broadcast(function(err, result) { /*...*/ });
import pushpad
project = pushpad.Pushpad(auth_token=AUTH_TOKEN, project_id=PROJECT_ID)
notification = pushpad.Notification(
project,
title="Web Notification Example",
body="Hello world!",
target_url="https://example.com"
)
# deliver to specific users
notification.deliver_to(('user1', 'user2'))
# deliver to segments
notification.broadcast(tags=['tag1', 'tag2'])
# deliver to everyone
notification.broadcast()
Pushpad pushpad = new Pushpad(authToken, projectId);
Notification notification = pushpad.buildNotification(
"Web Notification Example",
"Hello world!",
"https://example.com"
);
try {
// deliver to specific users
String[] users = {"user1", "user2"};
notification.deliverTo(users);
// deliver to segments
String[] tags = {"tag1", "tag2"};
notification.broadcast(tags);
// deliver to everyone
notification.broadcast();
} catch (DeliveryException e) {
e.printStackTrace();
}
pushpad.Configure("AUTH_TOKEN", "PROJECT_ID")
n := pushpad.Notification {
Title: "Web Notification Example",
Body: "Hello world!",
TargetURL: "https://example.com",
}
res, err := n.Send()
// deliver to specific users
n := pushpad.Notification { Body: "Hello world!", UIDs: []string{"user1", "user2"} }
res, err := n.Send()
// deliver to segments
n := pushpad.Notification { Body: "Hello world!", Tags: []string{"tag1", "tag2"} }
res, err := n.Send()
// deliver to everyone
n := pushpad.Notification { Body: "Hello world!" }
res, err := n.Send()
curl -X POST 'https://pushpad.xyz/api/v1/projects/PROJECT_ID/notifications' \
-H 'Authorization: Token token="AUTH_TOKEN"' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"notification": {
"title": "Web Notification Example",
"body": "Hello world!",
"target_url": "https://example.com"
},
"uids": ["user1", "user2"],
"tags": ["tag1", "tag2"]
}'