Skip to content

Instantly share code, notes, and snippets.

@faabiosr
Last active December 26, 2015 20:09
Show Gist options
  • Save faabiosr/7206999 to your computer and use it in GitHub Desktop.
Save faabiosr/7206999 to your computer and use it in GitHub Desktop.
Push Notification - Example
var Push = require('Push');
Push.addEventListener('register',function(e){
// Register push notification.
});
Push.addEventListener('received',function(e){
Titanium.Media.vibrate();
var dialog = Ti.UI.createAlertDialog({
message: e.push.data.alert,
title: 'Your App!'
});
dialog.show();
});
Push.addEventListener('enable',function(e){
// When push notification is enabled.
});
(function() {
Push.register();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment