{ "id": "84356", "key": "TIMOB-6928", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12093", "description": "", "name": "Sprint 2012-01", "archived": true, "released": true, "releaseDate": "2012-01-15" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-23T16:14:40.000+0000", "created": "2011-12-29T10:39:24.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_android", "qe-testadded", "regression" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2014-02-25T11:26:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2.Problem\r\n\r\nA call to {{Ti.Android.createPendingIntent()}} or {{Ti.Android.createNotification()}} fails with the following errors:\r\n\r\n{code} \r\nUncaught TypeError: Object [object Object] has no method 'createPendingIntent'\r\nUncaught TypeError: Object [object Object] has no method 'createNotification'\r\n{code} \r\n\r\nThe code runs fine in SDK 1.8.0.v20110913141920 (also using V8).\r\n\r\nThis problem completely kills any app that uses notifications.\r\n\r\nh2.Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win1 = Ti.UI.createWindow({ \r\n backgroundColor:'#fff',\r\n windowSoftInputMode:Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN,\r\n exitOnClose:true,\r\n navBarHidden:true\r\n});\r\n \r\nvar btn1 = Ti.UI.createButton({\r\n title:'Make Notification',\r\n width:'auto',\r\n top:100\r\n});\r\nfunction DoBtn1Click()\r\n{\r\n NewNotification(2,Ti.App.name,'I am workin here',null,null,true);\r\n}\r\nbtn1.addEventListener('click',DoBtn1Click);\r\nwin1.add(btn1);\r\n \r\nwin1.open();\r\n \r\nfunction NewNotification(ID, AppTitle, Content, Icon, Ticker, OnGoing)\r\n{\r\n var AppIntent=Ti.Android.createIntent({\r\n flags: Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP,\r\n className:'org.appcelerator.titanium.TiActivity',\r\n packageName:Ti.App.id\r\n });\r\n AppIntent.addCategory(Ti.Android.CATEGORY_LAUNCHER);\r\n var NotificationClickAction=Ti.Android.createPendingIntent({\r\n activity:Ti.Android.currentActivity,\r\n intent:AppIntent,\r\n flags:Ti.Android.FLAG_UPDATE_CURRENT,\r\n type:Ti.Android.PENDING_INTENT_FOR_ACTIVITY\r\n });\r\n var NotificationMembers = {contentTitle: AppTitle,\r\n contentText: Content,\r\n when: 0, // This will keep the time from showing on the notification\r\n contentIntent: NotificationClickAction\r\n };\r\n if (Icon != null)\r\n NotificationMembers.icon='images/'+Icon;\r\n else // default to barber pole\r\n NotificationMembers.icon=Ti.Android.R.drawable.progress_indeterminate_horizontal;\r\n \r\n if (Ticker != null)\r\n NotificationMembers.tickerText = Ticker;\r\n \r\n if ((OnGoing != null) && (OnGoing))\r\n NotificationMembers.flags = (Ti.Android.FLAG_ONGOING_EVENT | Ti.Android.FLAG_NO_CLEAR);\r\n \r\n Ti.Android.NotificationManager.notify(ID, Ti.Android.createNotification(NotificationMembers));\r\n}\r\n{code} \r\n\r\nh2. Relevant Q&A:\r\n[1.8.0.1 - createPendingIntent missing from Ti.Android|http://developer.appcelerator.com/question/129961/]\r\n\r\nAnother commenter reports the same problem (slightly different error msg) with Rhino.\r\n", "attachment": [], "flagged": false, "summary": "Android: Intents - missing createPendingIntent() and createNotification() methods", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "* Titanium SDK 1.8.0.1 (12/22/11 13:09 fbdc96f)\r\n* Android 2.2\r\n* emulator\r\n* JS Runtime V8 (also affects Rhino)\r\n* Windows XP\r\n* Mac OS (10.7.2)", "comment": { "comments": [ { "id": "177601", "author": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested this on Mac OS (10.7.2) with the same issue for 1.8.0.1", "updateAuthor": { "name": "mor_eli", "key": "mor_eli", "displayName": "Eli Mor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-29T10:59:54.000+0000", "updated": "2011-12-29T10:59:54.000+0000" }, { "id": "178070", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/1125", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-04T18:05:20.000+0000", "updated": "2012-01-04T18:05:20.000+0000" }, { "id": "179064", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 1.9.0.v20120111233134\r\nRuntime: V8, Rhino\r\nTitanium Studio, build: 1.0.8.201201111843\r\nDevice: Droid 3 (2.3.4)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-12T10:51:58.000+0000", "updated": "2012-01-12T10:51:58.000+0000" }, { "id": "180270", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening and closing this issue to update label and Fix Version field.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-23T16:14:25.000+0000", "updated": "2012-01-23T16:14:25.000+0000" }, { "id": "294571", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR Link: \nhttps://github.com/appcelerator/titanium_mobile/pull/5380", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-25T11:26:07.000+0000", "updated": "2014-02-25T11:26:07.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }