1
1
/* eslint no-underscore-dangle: ["error", { "allow": ["_id"] }] */
2
2
3
- import _ from 'lodash' ;
4
- import apn from 'apn' ;
5
- import gcm from 'node-gcm' ;
3
+ // import _ from 'lodash';
4
+ // import apn from 'apn';
5
+ // import gcm from 'node-gcm';
6
+ // import util from 'util';
6
7
7
- import apnProvider from './apn' ;
8
- import gcmProvider from './gcm' ;
8
+ // import apnProvider from './apn';
9
+ // import gcmProvider from './gcm';
9
10
import UserModel from '../../models/User' ;
10
11
import ProcedureModel from '../../models/Procedure' ;
12
+ // import CONFIG from '../../config/constants';
11
13
12
- const sendNotifications = ( { tokenObjects, message } ) => {
13
- const androidNotificationTokens = [ ] ;
14
+ // TODO: remove both eslint-disable-line
15
+ const sendNotifications = ( { tokenObjects, message } ) => { // eslint-disable-line
16
+ // Disable Push Notifications
17
+ return ; // eslint-disable-line
18
+ /* const androidNotificationTokens = [];
14
19
tokenObjects.forEach(({ token, os }) => {
15
20
switch (os) {
16
21
case 'ios':
@@ -19,7 +24,7 @@ const sendNotifications = ({ tokenObjects, message }) => {
19
24
20
25
note.alert = message;
21
26
// note.payload = { messageFrom: 'John Appleseed' };
22
- note . topic = 'de.democracy-deutschland.clientapp' ;
27
+ note.topic = CONFIG.APN_TOPIC ;
23
28
24
29
apnProvider.send(note, token).then((result) => {
25
30
console.log('apnProvider.send', result);
@@ -54,7 +59,7 @@ const sendNotifications = ({ tokenObjects, message }) => {
54
59
else console.log('gcmProvider', response);
55
60
},
56
61
);
57
- }
62
+ } */
58
63
} ;
59
64
60
65
const newVote = async ( { procedureId } ) => {
@@ -104,8 +109,13 @@ const procedureUpdate = async ({ procedureId }) => {
104
109
105
110
export { procedureUpdate , newVote , newPreperation } ;
106
111
107
- export default async ( { message, user } ) => {
108
- let userId ;
112
+ // TODO: remove both eslint-disable-line
113
+ export default async ( { message, user } ) => { // eslint-disable-line
114
+ // Disable Push Notifications
115
+ return ; // eslint-disable-line
116
+ // This function seems to be (partly) a duplicate of the sendNotifications function
117
+ // refactor?
118
+ /* let userId;
109
119
if (_.isObject(user)) {
110
120
userId = user._id;
111
121
}
@@ -120,10 +130,10 @@ export default async ({ message, user }) => {
120
130
121
131
note.alert = message;
122
132
// note.payload = { messageFrom: 'John Appleseed' };
123
- note . topic = 'de.democracy-deutschland.clientapp' ;
133
+ note.topic = CONFIG.APN_TOPIC ;
124
134
125
135
apnProvider.send(note, token).then((result) => {
126
- console . log ( 'apnProvider.send' , result ) ;
136
+ console.log('apnProvider.send', util.inspect( result, false, null) );
127
137
});
128
138
}
129
139
break;
@@ -156,5 +166,5 @@ export default async ({ message, user }) => {
156
166
},
157
167
);
158
168
}
159
- }
169
+ } */
160
170
} ;
0 commit comments