File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,4 +37,6 @@ webapp/public/js/register.js
3737
3838** /.env
3939services /gorush /config.yml
40+ services /gorush /* .pem
41+ services /gorush /* .p12
4042.vscode /
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ services:
7777 - 127.0.0.1:8102:8088
7878 volumes :
7979 - ./services/gorush/config.yml:/config.yml
80+ - ./services/gorush/Certificates.p12:/certs.p12
8081
8182 # [Express] Device ID Push Server
8283 # This service tracks uploaded device IDs and their platform.
Original file line number Diff line number Diff line change @@ -9,20 +9,23 @@ const platform = {
99
1010const generatePayload = async function ( title , message ) {
1111
12- let androidTokens = await getDevicesByPlatform ( platform . android ) ;
1312 return {
1413 notifications : [
1514 {
16- tokens : androidTokens ,
15+ tokens : await getDevicesByPlatform ( platform . android ) ,
1716 platform : platform . android ,
1817 message : message ,
1918 title : title
2019 } ,
21- // {
22- // tokens: await getDevicesByPlatform(platform.ios),
23- // platform: platform.ios,
24- // message: message
25- // }
20+ {
21+ tokens : await getDevicesByPlatform ( platform . ios ) ,
22+ platform : platform . ios ,
23+ message : message ,
24+ 'alert' : {
25+ 'title' : title ,
26+ 'body' : message ,
27+ }
28+ }
2629 ]
2730 } ;
2831} ;
@@ -33,10 +36,6 @@ module.exports = async function (req, res) {
3336 let payload = await generatePayload ( title , message ) ;
3437 let gorush = process . env . GORUSH_HOST ;
3538
36- console . log ( req . body ) ;
37- console . log ( title , message ) ;
38- console . log ( payload ) ;
39-
4039 request . post ( `${ gorush } /api/push` ,
4140 { json : payload } ,
4241 ( err , resp , body ) => {
You can’t perform that action at this time.
0 commit comments