Permalink
Browse files

documments public api

  • Loading branch information...
1 parent 7520432 commit 932c47e4ad1dadb59214f29cd930235e25426a11 @sgrebnov committed Feb 28, 2014
Showing with 23 additions and 9 deletions.
  1. +6 −6 src/windows8/NotificationHubProxy.js
  2. +17 −3 www/NotificationHub.js
@@ -30,13 +30,13 @@ module.exports = {
Windows.Networking.PushNotifications.PushNotificationChannelManager.createPushNotificationChannelForApplicationAsync().then(function (channel) {
notificationChannel = channel;
return (new NotificationHubRuntimeProxy.HubApi()).registerNativeAsync(notificationHubPath, connectionString, channel.uri);
- }).done(function (result) {
- var registration = {};
- registration.registrationId = result;
- registration.channelUri = notificationChannel.uri;
- registration.notificationHubPath = notificationHubPath;
+ }).done(function (result) {
+ var regInfo = {};
+ regInfo.registrationId = result;
+ regInfo.channelUri = notificationChannel.uri;
+ regInfo.notificationHubPath = notificationHubPath;
- success(registration);
+ success(regInfo);
}, fail);
} catch (ex) {
View
@@ -22,7 +22,13 @@
var exec = require('cordova/exec');
var Promise = require('./Promise');
-// http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.messaging.notificationhub.notificationhub.aspx
+/**
+ * Initializes a new instance of the NotificationHub class.
+ * http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.messaging.notificationhub.notificationhub.aspx
+ *
+ * @param {string} notificationHubPath The notification hub path (name).
+ * @param {string} connectionString The connection string.
+ */
var NotificationHub = function (notificationHubPath, connectionString) {
if (typeof notificationHubPath == 'undefined') {
throw new Error('Please specify notificationHubPath');
@@ -37,8 +43,12 @@ var NotificationHub = function (notificationHubPath, connectionString) {
this.onPushNotificationReceived = null;
};
-// tags - optional
-// http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.messaging.notificationhub.registerasync.aspx
+/**
+ * Asynchronously registers the device for native notifications.
+ * http://msdn.microsoft.com/en-us/library/dn339332.aspx
+ *
+ * @param {Array} tags The tags (not supported currently).
+ */
NotificationHub.prototype.registerApplicationAsync = function (tags) {
var deferral = new Promise.Deferral(),
@@ -65,6 +75,10 @@ NotificationHub.prototype.registerApplicationAsync = function (tags) {
return deferral.promise;
}
+/**
+ * Asynchronously unregisters the native registration on the application or secondary tiles.
+ * http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.messaging.notificationhub.unregisternativeasync.aspx
+ */
NotificationHub.prototype.unregisterApplicationAsync = function ()
{
var deferral = new Promise.Deferral(),

0 comments on commit 932c47e

Please sign in to comment.