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 11language : node_js
22node_js :
3- - ' 4.6 '
3+ - ' 8.9.1 '
44after_success : " ./node_modules/.bin/codecov"
55deploy :
66 provider : npm
Original file line number Diff line number Diff line change @@ -26,3 +26,36 @@ VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1
2626```
2727
2828This 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 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" : [
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}
Original file line number Diff line number Diff 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' :
You can’t perform that action at this time.
0 commit comments