Last active
December 26, 2015 20:09
-
-
Save faabiosr/7206999 to your computer and use it in GitHub Desktop.
Push Notification - Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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