Skip to content

Commit

Permalink
Add push apps (#101)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kostia-official authored Jan 18, 2017
1 parent 941590c commit 2a12af7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ PUSH_KEY - AWS key.
PUSH_SECRET - AWS secret.
PUSH_REGION - AWS SNS region.
PUSH_TITLE - Title for push notifications.
GSM_APP_ARN - Android ARN for AWS SNS.
APNS_APP_ARN - Apple iOS ARN for AWS SNS.
APPS_ARNS - Object with arn for every app. Example: {
"android": "arn:aws:sns:us-east-1:093525834944:app/GCM/android",
"ios": "arn:aws:sns:us-east-1:093525834944:app/APNS/ios"
}
DEFAULT_APP - default app from the list above.

SENTRY_DSN - DSN from getsentry.com
```
Expand Down
9 changes: 7 additions & 2 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ Notification Microservice.
{
"recipientId": "1",
"message": "Hello",
"payload": {}
"payload": {},
"app": { "name": "Enterprise" }
}

+ Response 201
Expand All @@ -108,6 +109,7 @@ Notification Microservice.
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"app": { "name": "Enterprise" },
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}]
Expand All @@ -120,7 +122,8 @@ Notification Microservice.
{
"token": "1",
"message": "Hello",
"payload": {}
"payload": {},
"app": { "name": "Enterprise" }
}

+ Response 201
Expand All @@ -129,6 +132,7 @@ Notification Microservice.
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"app": { "name": "Enterprise" },
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}
Expand All @@ -151,6 +155,7 @@ Notification Microservice.
"payload": {
"link": "inspection://inspection/123567/#comment-1234567"
},
"app": { "name": "Enterprise" },
"tokens": ["1", "2"]
},
"pubsub": {
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"node": "4.4.4"
},
"scripts": {
"test": "npm run lint && npm run dredd && npm run mocha",
"test": "npm run lint && npm run mocha",
"lint": "eslint --ignore-path .gitignore ./",
"start": "forever -m 5 --spinSleepTime 30000 --minUptime 1000 -af dist/",
"start:dev": "DEBUG=app* babel-node src/",
Expand All @@ -28,7 +28,6 @@
"build": "redrun clean babel",
"clean": "del ./dist",
"babel": "babel --source-maps --copy-files -d dist/ src/",
"postinstall": "if-env NODE_ENV=production && npm run build && npm prune --production || npm run build",
"deploy": "node ./deploy.js",
"deploy:staging": "docker build -t outfit/pingeon:staging . && docker push outfit/pingeon:staging",
"deploy:production": "docker build -t outfit/pingeon:production . && docker push outfit/pingeon:production"
Expand Down Expand Up @@ -61,7 +60,7 @@
"promdash": "1.1.0",
"raven": "0.12.1",
"serve-favicon": "2.3.0",
"smart-config": "0.7.2",
"smart-config": "0.7.3",
"source-map-support": "0.4.2",
"worque": "0.9.3"
},
Expand All @@ -77,7 +76,6 @@
"chai": "3.5.0",
"clear-require": "1.0.1",
"del-cli": "0.2.0",
"dredd": "1.0.11",
"eslint": "2.6.0",
"eslint-config-airbnb": "6.2.0",
"hooks": "0.3.2",
Expand Down
1 change: 0 additions & 1 deletion test/batch-notify-push.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require('./test-env');

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

Expand Down

0 comments on commit 2a12af7

Please sign in to comment.