Skip to content

Instantly share code, notes, and snippets.

@ferclaverino
Created November 12, 2012 16:41
Show Gist options
  • Save ferclaverino/4060395 to your computer and use it in GitHub Desktop.
Save ferclaverino/4060395 to your computer and use it in GitHub Desktop.
Subscribe to WNS and register the channel
function subscribeToPushNotification() {
var channelOperation = Windows.Networking.PushNotifications
.PushNotificationChannelManager
.createPushNotificationChannelForApplicationAsync()
.then(function (newChannel) {
channel = newChannel;
// Insert the new channel URI into the Channel table.
var client = getMobileServiceClient();
var channelTable = client.getTable('Channel');
channelTable.insert({ uri: channel.uri });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment