-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds a test-runner that sends notifications to all apps #10
adds a test-runner that sends notifications to all apps #10
Conversation
remove dependency put business logic in src folder sends a notification to each app, separated by 1000 ms Refactor sender module catches error in the app level gets the list of applications gets bearer token from UPS with existing client updates .gitignore
Let's add a README file in the folder, |
* @returns {Promise} An empty promise if the notification was sent. | ||
*/ | ||
static sendNotificationToApp(message, app, options) { | ||
console.log(`Sending message to "${app.name}" {${app.id}}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the id
to pushApplicationID
|
||
const settings = { | ||
url: BASE_URL, | ||
applicationId: app.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be pushApplicationID
too, instead of id
Use right property
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Jose Miguel Gallas Olmedo", | ||
"license": "MIT", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apache license!
also, not sure about the author tag... author is always a topic... that's hot discussed in the community. SCM tools do show all the authors of the file.
Perhaps we do AeroGear team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I wasn't sure so I left the default options.
OK I also noticed that the DELAY constant was not being used, so fixed |
This PR resolves this ticket: https://issues.jboss.org/browse/AGPUSH-2003
Adds a test-runner, written in nodeJS, to the current test suite. This test runner gets all applications from one user and send 1 notification to all of them with the single alias "TEST_TOKEN" that is the one mock-data-loader creates for all fake devices.
This test runner uses both community libraries: https://github.com/bucharest-gold/unifiedpush-admin-client (for retrieving the apps) and https://github.com/aerogear/aerogear-unifiedpush-nodejs-client/ (for sending the notifications).