Skip to content

Commit 2a12af7

Browse files
Add push apps (#101)
* Add support of different apps * Fix batch push notifications * Use fixed version of smart-config * Add default app config * Update docs * Remove dredd * Fix configs
1 parent 941590c commit 2a12af7

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ PUSH_KEY - AWS key.
3838
PUSH_SECRET - AWS secret.
3939
PUSH_REGION - AWS SNS region.
4040
PUSH_TITLE - Title for push notifications.
41-
GSM_APP_ARN - Android ARN for AWS SNS.
42-
APNS_APP_ARN - Apple iOS ARN for AWS SNS.
41+
APPS_ARNS - Object with arn for every app. Example: {
42+
"android": "arn:aws:sns:us-east-1:093525834944:app/GCM/android",
43+
"ios": "arn:aws:sns:us-east-1:093525834944:app/APNS/ios"
44+
}
45+
DEFAULT_APP - default app from the list above.
4346

4447
SENTRY_DSN - DSN from getsentry.com
4548
```

apiary.apib

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ Notification Microservice.
9999
{
100100
"recipientId": "1",
101101
"message": "Hello",
102-
"payload": {}
102+
"payload": {},
103+
"app": { "name": "Enterprise" }
103104
}
104105

105106
+ Response 201
@@ -108,6 +109,7 @@ Notification Microservice.
108109
"message": "Hello",
109110
"providerMessageId": "2",
110111
"payload": {},
112+
"app": { "name": "Enterprise" },
111113
"sendDate": "2016-05-20T17:19:15.602Z",
112114
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
113115
}]
@@ -120,7 +122,8 @@ Notification Microservice.
120122
{
121123
"token": "1",
122124
"message": "Hello",
123-
"payload": {}
125+
"payload": {},
126+
"app": { "name": "Enterprise" }
124127
}
125128

126129
+ Response 201
@@ -129,6 +132,7 @@ Notification Microservice.
129132
"message": "Hello",
130133
"providerMessageId": "2",
131134
"payload": {},
135+
"app": { "name": "Enterprise" },
132136
"sendDate": "2016-05-20T17:19:15.602Z",
133137
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
134138
}
@@ -151,6 +155,7 @@ Notification Microservice.
151155
"payload": {
152156
"link": "inspection://inspection/123567/#comment-1234567"
153157
},
158+
"app": { "name": "Enterprise" },
154159
"tokens": ["1", "2"]
155160
},
156161
"pubsub": {

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"node": "4.4.4"
1919
},
2020
"scripts": {
21-
"test": "npm run lint && npm run dredd && npm run mocha",
21+
"test": "npm run lint && npm run mocha",
2222
"lint": "eslint --ignore-path .gitignore ./",
2323
"start": "forever -m 5 --spinSleepTime 30000 --minUptime 1000 -af dist/",
2424
"start:dev": "DEBUG=app* babel-node src/",
@@ -28,7 +28,6 @@
2828
"build": "redrun clean babel",
2929
"clean": "del ./dist",
3030
"babel": "babel --source-maps --copy-files -d dist/ src/",
31-
"postinstall": "if-env NODE_ENV=production && npm run build && npm prune --production || npm run build",
3231
"deploy": "node ./deploy.js",
3332
"deploy:staging": "docker build -t outfit/pingeon:staging . && docker push outfit/pingeon:staging",
3433
"deploy:production": "docker build -t outfit/pingeon:production . && docker push outfit/pingeon:production"
@@ -61,7 +60,7 @@
6160
"promdash": "1.1.0",
6261
"raven": "0.12.1",
6362
"serve-favicon": "2.3.0",
64-
"smart-config": "0.7.2",
63+
"smart-config": "0.7.3",
6564
"source-map-support": "0.4.2",
6665
"worque": "0.9.3"
6766
},
@@ -77,7 +76,6 @@
7776
"chai": "3.5.0",
7877
"clear-require": "1.0.1",
7978
"del-cli": "0.2.0",
80-
"dredd": "1.0.11",
8179
"eslint": "2.6.0",
8280
"eslint-config-airbnb": "6.2.0",
8381
"hooks": "0.3.2",

test/batch-notify-push.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require('./test-env');
22

3-
const config = require('smart-config');
43
const { toObject } = require('node-helpers');
54
const Notification = require('../src/services/notification/model');
65

0 commit comments

Comments
 (0)