dispatch:emissary-transport-raix-push

v0.11.1Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Push Transport

Send a push notification using the raix:push

Setup

Add the package as a dependency of another package:

1api.use(['dispatch:emissary-transport-raix-push'], 'server');

Or just use it in your root application:

$ meteor add dispatch:emissary-transport-raix-push

Usage

Configuration/Working the Queue

The pushConfig is passed verbatim for raix:push. Please see the documentation for that package.

1var transport = new PushTransport({
2  from:'your app',
3  pushConfig:{...}
4});
5
6transport.register();

The above will create a new Push transport and register it to work "push" messages in the Emissary job queue.

Queuing Messages

The badge and payload arguments are optional. Payload is passed verbatim to the push notification payload, so you can use it in your app.

1Emissary.queueTask('push', {
2  bodyTemplate:'<handlebars template>',
3  subjectTemplate:'<handlebars template>',
4  templateData:{},
5  to:{
6    userId:'<meteor user ID>',
7    badge:0,
8    payload:{}
9  }
10})