Skip to content

Instantly share code, notes, and snippets.

@skypanther
Created October 4, 2011 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skypanther/1262472 to your computer and use it in GitHub Desktop.
Save skypanther/1262472 to your computer and use it in GitHub Desktop.
function createNotification() {
var mainIntent = Titanium.Android.createIntent({
className: 'org.appcelerator.titanium.TiActivity',
packageName: 'com.appcelerator.foo'
});
var pending = Titanium.Android.createPendingIntent({
activity: Titanium.Android.currentActivity,
intent: mainIntent,
type: Titanium.Android.PENDING_INTENT_FOR_ACTIVITY,
flags: Titanium.Android.FLAG_UPDATE_CURRENT
});
var notification = Titanium.Android.createNotification({
icon: 0x7f020000,
contentTitle: 'MainApp',
contentText: 'Re-open MainApp...',
tickerText: 'Notification added...',
contentIntent: pending
});
Titanium.Android.NotificationManager.notify(42, notification);
}
createNotification();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment