
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
unifiedpush-node-sender
Advanced tools
Node Sender API for the AeroGear Unified Push server
note: This version of the sender is compatible with the 1.1.x series of the UnifiedPush Server
Project Info | |
---|---|
License: | Apache License, Version 2.0 |
Build: | npm |
Documentation: | https://aerogear.org/push/ |
Issue tracker: | https://issues.jboss.org/browse/AGPUSH |
Mailing lists: | aerogear-users (subscribe) |
aerogear-dev (subscribe) |
clone and install:
$ git@github.com:aerogear/aerogear-unifiedpush-nodejs-client.git
$ cd aerogear-unifiedpush-nodejs-client
$ npm install
$ npm test
In your project do
npm install path/to/aerogear-unified-push-node-client
or
install from npm
npm install unifiedpush-node-sender
Require the unifiedpush-node-sender
library
const agSender = require('unifiedpush-node-sender');
const settings = {
url: 'http://localhost:8080/ag-push',
applicationId: '12345',
masterSecret: '123456'
};
First get a handle on the client
object, then use the client.sender.send
method to send a message
agSender(settings).then((client) => {
client.sender.send(message, options).then((response) => {
console.log('success', response);
})
});
Similar to the send
method but passing an array of {message, options}
objects as parameter instead.
agSender(settings).then((client) => {
client.sender.sendBatch(messages).then((response) => {
console.log('success', response);
})
});
The Sender Class, It returns a Promise with the client
object
settings
Object
url
String - The URL of the Unified Push Server.applicationId
String - The id of an Application from the Unified Push ServermasterSecret
String - The master secret for that Applicationheaders
Object - The hash of custom HTTP headers / header overridesmessage
Object
alert
String - message that will be displayed on the alert UI elementpriority
String - sets a processing priority on a push message. values can be 'normal' or 'high'sound
String - The name of a sound filebadge
String - The number to display as the badge of the app iconuserData
Object - any extra user data to be passedmessage.apns
Object
title
String - A short string describing the purpose of the notification.action
String - The label of the action buttonurlArgs
Array - an array of values that are paired with the placeholders inside the urlFormatString value of your website.json file. Safari OnlytitleLocKey
String - The key to a title string in the Localizable.strings file for the current localization. iOS OnlytitleLocArgs
Array - Variable string values to appear in place of the format specifiers in title-loc-key. iOS OnlyactionCategory
String - the identifier of the action category for the interactive notificationcontentAvailable
Boolean - Provide this key with a value of 1 to indicate that new content is available. iOS Onlymessage.windows
Object
type
String - The type of message to send toast, raw, badge or tile.duration
String - Duration a Toast message is displayed 'long' or 'short'badge
String - Badge notifications type for badges that are not numbers (none, activity, alert, available, away, busy, newMessage, paused, playing, unavailable, error or attention), for numbers use the value in the main part of the message.tileType
String - Different type of tile messages with different sizes see the [tile template catalog]{@link https://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx} e.g. 'TileSquareText02' or 'TileWideBlockAndText02'images
Array - Images either local or remote need match the nubmer of the tileTypetextFields
Array - Texts needs to be same as the number of the tileTypeoptions
Object
options.config
Object
ttl
Number - the time to live in seconds. This value is supported by APNs and GCM Onlyoptions.criteria
Object
alias
Array - a list of email or name stringsdeviceType
Array - a list of device types as stringscategories
Array - a list of categories as stringsvariants
Array - a list of variantID's as stringsThere was a bug in the send method. The UPS was sending back a 202, but we were looking for a 200, therefore all promises were rejecting. Oops
Promise rejections now return proper Error
objects - 3f1a2a1. Thanks (evanshortiss)[https://github.com/evanshortiss]
0.13.0 is pretty much a complete re-write of the client. It now only returns Promises.
It also require at least node 4.x or greater.
The way in which the send
method is invoked has changed also. Check out the example above to see the new way of using this library
For more information about the Unified Push Server's REST sender API, look here
If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.
Also takes some time and skim the contributor guide
The code is documented in JSDoc and can be generated in docs
folder by running:
npm run docs
Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!
If you found a bug please create a ticket for us on Jira with some steps to reproduce it.
FAQs
Sender api for the AeroGear Unified Push server
The npm package unifiedpush-node-sender receives a total of 2 weekly downloads. As such, unifiedpush-node-sender popularity was classified as not popular.
We found that unifiedpush-node-sender demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.