This repository has been archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 566
Service Bus Notification Hubs
glennblock edited this page Feb 1, 2013
·
31 revisions
This feature will enable developers to send push notifications from their node.js applications simultaneously to hundreds of thousands or mobile clients across IOS and Windows 8. Each message has a tag associated with it. When clients subscribe, they can choose which tags are of interest. As messages are published, Notification Hubs will ensure messages go only to those clients who subscribed to that.
Below is a quick snippet for how to use the new api. In the snippet below a new Notification Hub is created, configuring credentials for both apns and wns. Two messages are then sent with different tags to both IOS and Windows 8 devices.
var azure = require('azure');
var credentials = {
wns:{
packageSid: "...",
clientSecret: "..."
},
apns:{
keyData: "...",
certData: "..."
}
}
var nhs = azure.createNotificationHubService();
var nh = nhs.createNotificationHub('myhub', credentials);
nh.wns.send("tag1", wnsPayload);
var apnsPayload = {
"alert" : "You got your emails.",
"badge" : 9,
"sound" : "bingbong.aiff"
}
nh.apns.send("tag2", apnsPayload, function(err, response) {...});