Skip to content

Commit

Permalink
Add deleteAllPushes function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwhitman committed Jan 2, 2016
1 parent 8ff8f34 commit 9a54a8f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 2.0.0-dev

- Remove support for deprecated `list` and `address` push types.
- Add `deleteAllPushes` function.

### 1.4.3

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ Delete a push.
pusher.deletePush('udhrSpjAewzdwpCC', function(error, response) {});
```

### PushBullet.deleteAllPushes(callback)

Delete all pushes associated with the current account.

```javascript
pusher.deleteAllPushes(function(error, response) {});
```

### PushBullet.history([options], callback)

Get the push history.
Expand Down
13 changes: 13 additions & 0 deletions lib/pushbullet.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,19 @@ PushBullet.prototype.deletePush = function deletePush(pushIden, callback) {
});
};

/**
* Delete all pushes belonging to the current user.
*
* @param {Function} callback Called when the request is complete.
*/
PushBullet.prototype.deleteAllPushes = function deleteAllPushes(callback) {
var self = this;

self.request.del(PUSH_END_POINT, function(error, response, body) {
self.handleResponse(error, response, body, callback);
});
};

/**
* Get a list of devices which can be pushed to.
*
Expand Down

0 comments on commit 9a54a8f

Please sign in to comment.