Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17358] Android: Refactor notifications

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-11-12T18:30:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.0.0
ComponentsAndroid
Labelsandroid-l
ReporterIngo Muschenetz
AssigneeHieu Pham
Created2014-07-22T16:23:47.000+0000
Updated2015-03-12T23:59:33.000+0000

Description

Our current implementation is deprecated, and likely to stop working with Android L.

Comments

  1. Allen Yeung 2014-07-22

    Putting a SWAG of 2 weeks. We may want to consider adding some of the new features into notifications as well. We will also want to confirm that the new approach will work with Android Wear devices.
  2. Ingo Muschenetz 2014-08-20

    * Set up Eclipse * Set up Android studio * Update Studio * Update CLI * Refactoring notification
  3. Ingo Muschenetz 2014-08-26

    This requires an update to the AppCompat library which is not at GA status yet. Thus, we will be merging this to the master branch (not 3.4.0). Once Android L is closer to release and the proper components are available, we can slot this in. My goal is this would appear on the 3.4.X branch as soon as is feasible, and likely ship with 3.4.1.
  4. Hieu Pham 2014-10-21

    master PR: https://github.com/appcelerator/titanium_mobile/pull/6247
  5. Mark Mokryn 2014-10-24

  6. Hieu Pham 2014-11-06

  7. Ingo Muschenetz 2014-11-07

    Confirmed, we can merge this into 3.4.2.
  8. Hieu Pham 2014-11-10

    Test case for new features of notification:
       // Create the notification
       var notification = Titanium.Android.createNotification({
           contentTitle: 'Notification 1',
           contentText : 'Just a notification',
           category: Titanium.Android.CATEGORY_MESSAGE,
           priority: Titanium.Android.PRIORITY_HIGH
       });
       
       // Create the notification
       var notification2 = Titanium.Android.createNotification({
           contentTitle: 'Notification 2',
           contentText : 'Just another notification',
       });
       
       var window = Ti.UI.createWindow();
       var button = Ti.UI.createButton({
       	title: 'Send Notification 1',
       	top:100
       });
       
       var button2 = Ti.UI.createButton({
       	title: 'Send Notification 2',
       	top: 300
       });
       
       window.add(button);
       window.add(button2);
       window.open();
       
       button.addEventListener('click', function(e) {
       	// Send the notification.
       	Titanium.Android.NotificationManager.notify(1, notification);
       });
       
       button2.addEventListener('click', function(e) {
       	// Send the notification.
       	Titanium.Android.NotificationManager.notify(2, notification2);
       });
       
    1. Send notification 1 first, then send notification 2. 2. Since notification 1 has higher priority than 2, 1 will be on top of 2. If you remove priority of notification 1, then repeat step 1, notification 2 will be on top of notification 1.
  9. Ping Wang 2014-11-11

  10. Hieu Pham 2014-11-13

    3.4.X PR: https://github.com/appcelerator/titanium_mobile/pull/6346
  11. Lokesh Choudhary 2015-03-12

    Verified the fix and support for notifications for android 5.0. Closing. Environment: Appc Studio : 4.0.0.201503062102 Ti SDK : 4.0.0.v20150312095013 CLI : 3.5.0-dev Alloy : 1.5.1 MAC Yosemite : 10.10.2 Nexus 5 - Android 5.0

JSON Source