Skip to content

Commit e032953

Browse files
committed
Update docs
1 parent e8f9d51 commit e032953

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ npm install node-pushnotifications
2525
*iOS:* Prepare cert.pem and key.pem as described in [node-apn](https://github.com/argon/node-apn/wiki/Preparing-Certificates)
2626

2727
Import and setup push module:
28+
2829
```js
2930
var settings = {
3031
gcm: {
@@ -68,8 +69,11 @@ GCM and ADM options: see [node-gcm](https://github.com/ToothlessGear/node-gcm#cu
6869

6970
APN options: see [node-apn](https://github.com/argon/node-apn/blob/master/doc/connection.markdown)
7071

72+
MPNS options see [mpns](https://github.com/jeffwilcox/mpns)
73+
7174

7275
Define destination device ID. You can send to multiple devices, independently of platform, creating an array with different destination device IDs.
76+
7377
```js
7478
// Single destination
7579
var deviceIds = 'INSERT_YOUR_DEVICE_ID';
@@ -80,18 +84,25 @@ deviceIds.push('INSERT_YOUR_DEVICE_ID');
8084
deviceIds.push('INSERT_OTHER_DEVICE_ID');
8185
```
8286

83-
Next, create a JSON object witch MUST contain, at least, a title and message and send it to server.
87+
Next, create a JSON object witch MUST contain, at least, a title and message and send it to server.
88+
8489
```js
8590
var data = {
8691
title: 'New push notification',
8792
message: 'Powered by AppFeel',
8893
otherfields: 'optionally add more data'
8994
};
90-
push.send(deviceIds, data, function (result) {
91-
console.log(result);
95+
push.send(deviceIds, data, function (err, result) {
96+
if (err) {
97+
console.log(err);
98+
} else {
99+
console.log(result);
100+
}
92101
});
93102
```
94-
Result will contain 'true' or 'an error description'.
103+
104+
Error will be null if all went fine, will return the error otherwise.
105+
Result will contain 'true' if all went fine.
95106

96107

97108
##Resources

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "node-pushnotifications",
33
"description": "A cross-platform push service for Node.js",
4-
"version": "0.1.9",
4+
"version": "0.1.10",
55
"author": {
66
"name": "AppFeel",
77
"email": "info@appfeel.com"

0 commit comments

Comments
 (0)