Skip to content

Commit

Permalink
agent: [scenarios] import all
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Apr 1, 2013
1 parent e359ea8 commit 0a0a79d
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
16 changes: 16 additions & 0 deletions agent/badge.js
@@ -0,0 +1,16 @@
/*!
* Dependencies
*/

var agent = require('./_header')
, device = require('../device');

/*!
* Send message
*/

agent.createMessage()
.device(device)
.alert('Time to set the badge number to 3.')
.badge(3)
.send();
17 changes: 17 additions & 0 deletions agent/custom.js
@@ -0,0 +1,17 @@
/*!
* Dependencies
*/

var agent = require('./_header')
, device = require('../device');

/*!
* Send message
*/

agent.createMessage()
.device(device)
.alert('Custom variables')
.set('id_1', 12345)
.set('id_2', 'abcdef')
.send();
33 changes: 33 additions & 0 deletions agent/expires.js
@@ -0,0 +1,33 @@
/*!
* Dependencies
*/

var agent = require('./_header')
, device = require('../device');

/*!
* Send messages
*/

// set default to one day
agent.set('expires', '1d');

// send using default 1d
agent.createMessage()
.device(device)
.alert('You were invited to a new event.')
.send();

// use custom for 1 hour
agent.createMessage()
.device(device)
.alert('New Event @ 4pm')
.expires('1h')
.send();

// set custom no expiration
agent.createMessage()
.device(device)
.alert('Event happening now!')
.expires(0)
.send();
15 changes: 15 additions & 0 deletions agent/hello.js
@@ -0,0 +1,15 @@
/*!
* Dependencies
*/

var agent = require('./_header')
, device = require('../device');

/*!
* Send message
*/

agent.createMessage()
.device(device)
.alert('Hello Universe!')
.send();
Empty file removed agent/hello_universe.js
Empty file.

0 comments on commit 0a0a79d

Please sign in to comment.