Skip to content
This repository was archived by the owner on Aug 28, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Easily send notifications over several protocols.
## Install

```
npm install push-notify
npm install push-notify-patched
```

## Usage
Expand Down
6 changes: 4 additions & 2 deletions lib/protocols/apn.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ Sender.prototype.send = function (data) {
// Token can be string or array.
if (! _.isArray(data.token)) data.token = [data.token];

data.topic = this.options.topic;

// Create notification.
var notification = new apn.Notification();
_.merge(notification, _.omit(data, 'token'));

// Push notification.
this.connection.pushNotification(notification, data.token);
this.connection.send(notification, data.token);
};

/**
Expand Down Expand Up @@ -76,7 +78,7 @@ Sender.prototype.close = function (cb) {
*/

Sender.prototype.createConnection = function () {
var connection = new apn.Connection(this.options);
var connection = new apn.Provider(this.options);

pipeEvent([
'error',
Expand Down
Loading