Skip to content

A Deployd module for connectivity to the Google Cloud Messaging (GCM) and Apple Push Notification Service (APNs)

License

Notifications You must be signed in to change notification settings

j0ergo/dpd-pushnotifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dpd-pushnotifications

A very simple Deployd Resource for connectivity to the Google Cloud Messaging (GCM) and Apple Push Notification Service (APNs)

Include in your package.json like

  "dependencies": {
    "dpd-pushnotifications": "git+ssh://[email protected]:ozzroach/dpd-pushnotifications.git"
  }

then do

npm install

##Configuration

For iOS Push Notifications, node-apn (https://github.com/argon/node-apn) needs a key.pem and a cert.pem. It is assumed, that these files are located in ./config of the Deployd application.

##Usage in a Deployd-Event-Handler:

For Android:

dpd.pushnotifications.post({
		gcmRegistrationIds: ["...", "..."],
		title: "...",
		message: "...",
		msgcnt: "...",
		soundname: "...",
		collapseKey: "...",
		delayWhileIdle: true,
		timeToLive: 4000
	},
	function (err, results) {
    	console.log(results);
	}
)

For iOS:

dpd.pushnotifications.post({
		apnTokens: ["...", "..."],
		message: "...",
		msgcnt: "...",
		soundname: "...",
		timeToLive: 4000
	},
	function (err, results) {
    	console.log(results);
	}
)

About

A Deployd module for connectivity to the Google Cloud Messaging (GCM) and Apple Push Notification Service (APNs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published