Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Issue #18: iOS badge number
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Jun 28, 2015
1 parent e08eb59 commit 8377bc4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions www/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ PushNotification.prototype.unregister = function(successCallback, errorCallback,
exec(successCallback, errorCallback, "PushNotification", "unregister", [options]);
};

/**
* Call this to set the application icon badge
*/

PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) {
if (errorCallback == null) { errorCallback = function() {}}

if (typeof errorCallback != "function") {
console.log("PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function");
return
}

if (typeof successCallback != "function") {
console.log("PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function");
return
}

cordova.exec(successCallback, errorCallback, "PushNotification", "setApplicationIconBadgeNumber", [{badge: badge}]);
};

/**
* Listen for an event.
*
Expand Down

0 comments on commit 8377bc4

Please sign in to comment.