/lib/titanium/mobile/android/NotificationManager.hx

http://github.com/visup/haxe-titanium-api · Haxe · 87 lines · 21 code · 5 blank · 61 comment · 0 complexity · fee795b50cb123b071bf1418c9325b24 MD5 · raw file

  1. package titanium.mobile.android;
  2. /**
  3. NotificationManager class
  4. Documentation available at:
  5. http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Android.NotificationManager-module
  6. - namespace
  7. Titanium.Android.NotificationManager
  8. - type
  9. module
  10. - description
  11. Module to notify users of events that happen. It is a thin wrapper on [NotificationManager](http://developer.android.com/reference/android/app/NotificationManager.html).
  12. - since
  13. 1.5
  14. - platforms
  15. android
  16. - methods
  17. cancel: Cancel a previously shown notification.
  18. cancelAll: Cancel all previously shown notifications.
  19. notify: Add a persistent notification to the status bar.
  20. - method : cancel
  21. id[int]: The id you assigned to a notification.
  22. - method : cancelAll
  23. - method : notify
  24. id[int] : An id that may be used to cancel a shown notification.
  25. notification[`Titanium.Android.Notification`] : An instance of `Titanium.Android.Notification` created with `Titanium.Android.createNotification`.
  26. - properties
  27. DEFAULT_ALL[int] : Use all default values (where applicable).
  28. DEFAULT_LIGHTS[int] : Use the default notification lights.
  29. DEFAULT_SOUND[int] : Use the default notification sound.
  30. DEFAULT_VIBRATE[int] : Use the default notification vibrate.
  31. FLAG_AUTO_CANCEL[int] : Bit to be bitwise-ored into the flags field that should be set if the notification should be canceled when it is clicked by the user.
  32. FLAG_INSISTENT[int] : Bit to be bitwise-ored into the flags field that if set, the audio will be repeated until the notification is cancelled or the notification window is opened.
  33. FLAG_NO_CLEAR[int] : Bit to be bitwise-ored into the flags field that should be set if the notification should not be canceled when the user clicks the Clear all button.
  34. FLAG_ONGOING_EVENT[int] : Bit to be bitwise-ored into the flags field that should be set if this notification is in reference to something that is ongoing, like a phone call.
  35. FLAG_ONLY_ALERT_ONCE[int] : Bit to be bitwise-ored into the flags field that should be set if you want the sound and/or vibration play each time the notification is sent, even if it has not been canceled before that.
  36. FLAG_SHOW_LIGHTS[int] : Bit to be bitwise-ored into the flags field that should be set if you want the LED on for this notification.
  37. STREAM_DEFAULT[int] : Use this constant as the value for audioStreamType to request that the default stream type for notifications be used.
  38. - notes
  39. The constants above are taken from [Notification](http://developer.android.com/reference/android/app/Notification.html).
  40. **/
  41. #if androidos
  42. @:native("Titanium.Android.NotificationManager")
  43. extern class NotificationManager
  44. {
  45. // constants
  46. public static var DEFAULT_ALL:Int;
  47. public static var DEFAULT_LIGHTS:Int;
  48. public static var DEFAULT_SOUND:Int;
  49. public static var DEFAULT_VIBRATE:Int;
  50. public static var FLAG_AUTO_CANCEL:Int;
  51. public static var FLAG_INSISTENT:Int;
  52. public static var FLAG_NO_CLEAR:Int;
  53. public static var FLAG_ONGOING_EVENT:Int;
  54. public static var FLAG_ONLY_ALERT_ONCE:Int;
  55. public static var FLAG_SHOW_LIGHTS:Int;
  56. public static var STREAM_DEFAULT:Int;
  57. // static methods
  58. public static function cancel(id:Int):Void;
  59. public static function cancelAll():Void;
  60. public static function notify(id:Int, notification:Notification):Void;
  61. }
  62. #end