Skip to content

Commit 3c73f1c

Browse files
flovilmartTylerBrock
authored andcommitted
Bumps to alpha version of node-apn
- Bumps engine - Bumps CI - Adds instructions for using custom adapter
1 parent 0c4ee64 commit 3c73f1c

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

.nvmrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
4.6
2-
1+
8.9.1

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- '4.6'
3+
- '8.9.1'
44
after_success: "./node_modules/.bin/codecov"
55
deploy:
66
provider: npm

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,36 @@ VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1
2626
```
2727

2828
This will produce a more verbose output for all the push sending attempts
29+
30+
### Using a custom version on parse-server
31+
32+
#### Install the push adapter
33+
34+
```
35+
npm install --save @parse/push-adapter@VERSION
36+
```
37+
38+
Replace VERSION with the version you want to install.
39+
40+
#### Configure parse-server
41+
42+
```js
43+
const PushAdapter = require('@parse/push-adapter').default;
44+
const pushOptions = {
45+
ios: { /* iOS push options */ } ,
46+
android: { /* android push options */ }
47+
}
48+
// starting 3.0.0
49+
const options = {
50+
appId: "****",
51+
masterKey: "****",
52+
push: {
53+
adapter: new PushAdapter(pushOptions),
54+
},
55+
/* ... */
56+
}
57+
58+
const server = new ParseServer(options);
59+
60+
/* continue with the initialization of parse-server */
61+
```

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@parse/push-adapter",
3-
"version": "2.0.3",
3+
"version": "3.0.0-alpha2",
44
"description": "Base parse-server-push-adapter",
55
"main": "lib/index.js",
66
"files": [
@@ -33,12 +33,12 @@
3333
"nyc": "^11.0.2"
3434
},
3535
"dependencies": {
36-
"apn": "^2.1.3",
36+
"apn": "^3.0.0-alpha1",
3737
"@parse/node-gcm": "^0.14.0",
3838
"npmlog": "^4.0.2",
3939
"parse": "^1.9.2"
4040
},
4141
"engines": {
42-
"node": ">= 4.6.0"
42+
"node": ">= 8.9.1"
4343
}
4444
}

src/ParsePushAdapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ export default class ParsePushAdapter {
2121
let pushTypes = Object.keys(pushConfig);
2222

2323
for (let pushType of pushTypes) {
24-
if (this.validPushTypes.indexOf(pushType) < 0) {
24+
// adapter may be passed as part of the parse-server initialization
25+
if (this.validPushTypes.indexOf(pushType) < 0 && pushType != 'adapter') {
2526
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
26-
'Push to ' + pushType + ' is not supported');
27+
'Push to ' + pushType + ' is not supported');
2728
}
2829
switch (pushType) {
2930
case 'ios':

0 commit comments

Comments
 (0)