File tree Expand file tree Collapse file tree 5 files changed +41
-8
lines changed Expand file tree Collapse file tree 5 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 1
- 4.6
2
-
1
+ 8.9.1
Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
- - ' 4.6 '
3
+ - ' 8.9.1 '
4
4
after_success : " ./node_modules/.bin/codecov"
5
5
deploy :
6
6
provider : npm
Original file line number Diff line number Diff line change @@ -26,3 +26,36 @@ VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1
26
26
```
27
27
28
28
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
+ ```
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @parse/push-adapter" ,
3
- "version" : " 2 .0.3 " ,
3
+ "version" : " 3 .0.0-alpha2 " ,
4
4
"description" : " Base parse-server-push-adapter" ,
5
5
"main" : " lib/index.js" ,
6
6
"files" : [
33
33
"nyc" : " ^11.0.2"
34
34
},
35
35
"dependencies" : {
36
- "apn" : " ^2.1.3 " ,
36
+ "apn" : " ^3.0.0-alpha1 " ,
37
37
"@parse/node-gcm" : " ^0.14.0" ,
38
38
"npmlog" : " ^4.0.2" ,
39
39
"parse" : " ^1.9.2"
40
40
},
41
41
"engines" : {
42
- "node" : " >= 4.6.0 "
42
+ "node" : " >= 8.9.1 "
43
43
}
44
44
}
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ export default class ParsePushAdapter {
21
21
let pushTypes = Object . keys ( pushConfig ) ;
22
22
23
23
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' ) {
25
26
throw new Parse . Error ( Parse . Error . PUSH_MISCONFIGURED ,
26
- 'Push to ' + pushType + ' is not supported' ) ;
27
+ 'Push to ' + pushType + ' is not supported' ) ;
27
28
}
28
29
switch ( pushType ) {
29
30
case 'ios' :
You can’t perform that action at this time.
0 commit comments