{ "id": "82600", "key": "TIMOB-6142", "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": "15691", "description": "2013 Sprint 19", "name": "2013 Sprint 19", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "15693", "description": "2013 Sprint 19 API", "name": "2013 Sprint 19 API", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-11T06:07:54.000+0000", "created": "2011-11-10T10:46:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "exalture", "module_android", "qe-testadded", "tbs-1.9.0" ], "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": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-04-21T11:26:36.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": "createBroadcastIntent is not callable from Ti.Android, we need to make sure it's exposed and working as intended. We have a community pull request here:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/655\r\n\r\nh3. Test case for sendBroadcast\r\n\r\nRun the following app, press the button therein and then check the log for \"Broadcast received\".\r\n\r\n{code:title=app.js}\r\n var win = Ti.UI.createWindow();\r\n\t\r\n var br = Ti.Android.createBroadcastReceiver({\r\n\t onReceived: function() {\r\n\t Ti.API.info('Broadcast received.');\r\n\t }\r\n });\r\n\r\n Ti.Android.registerBroadcastReceiver(br,[\"com.exalture.test.broadcastreceiver\"]);\r\n\r\n var sendBroadcastBtn = Ti.UI.createButton({top:100,width:300,title:\"SendBroadcast\"});\r\n\tsendBroadcastBtn.addEventListener('click', function()\r\n\t\t\t{\r\n\t\t var intent = Ti.Android.createBroadcastIntent({\r\n\t \t\t \taction: \"com.exalture.test.broadcastreceiver\"\r\n\t \t\t\t });\r\n\t\t\t \t Ti.Android.currentActivity.sendBroadcast(intent);\r\n\t\t\t \r\n\t\t\t});\r\n\t\r\n win.add(sendBroadcastBtn);\r\n\t\r\n win.open();\r\n{code}\r\n\r\nh3. Test case for sendBroadcastWithPermission. \r\n\r\nFirst, you need to both define the permission and \"use\" it in the manifest section of the \"android\" section of your tiapp.xml. So make the tiapp.xml's \"android\" section look like this:\r\n\r\n{code}\r\n\r\n \r\n \r\n \r\n \r\n\r\n{code}\r\n\r\nThe run the following app, press the button therein and check the log for \"Broadcast received with permission\":\r\n\r\n{code:title=app.js}\r\n var win = Ti.UI.createWindow();\r\n\t\r\n var brWithPermission = Ti.Android.createBroadcastReceiver({\r\n\t onReceived: function() {\r\n\t Ti.API.info('Broadcast received with permission.');\r\n\t }\r\n\t});\r\n\t\r\n Ti.Android.registerBroadcastReceiver(brWithPermission, [\"com.exalture.test.broadcastreceiver\"]);\r\n\r\n var sendBroadcastBtn = Ti.UI.createButton({top:100,width:300,title:\"SendBroadcast\"});\r\n\tsendBroadcastBtn.addEventListener('click', function()\r\n\t\t\t{\r\n\t\t\t\t var intentWithPermission = Ti.Android.createBroadcastIntent({\r\n\t \t\t\taction: \"com.exalture.test.broadcastreceiver\"\r\n\t \t\t\t});\r\n\t\t\t \t Ti.Android.currentActivity.sendBroadcastWithPermission(intentWithPermission, \"com.exalture.test.withPermission\");\r\n\t\t\t \r\n\t\t\t});\r\n\t\r\n win.add(sendBroadcastBtn);\r\n\t\r\n win.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Expose createBroadcastIntent in ActivityProxy", "creator": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "172274", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Will we need to expose Activity.sendBroadcast to make this useable?", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-10T21:31:02.000+0000", "updated": "2011-11-10T21:31:02.000+0000" }, { "id": "172301", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yeah, maybe others as well", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-11T08:28:54.000+0000", "updated": "2011-11-11T08:28:54.000+0000" }, { "id": "234554", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "Any chance of this being implemented? ", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-16T05:56:26.000+0000", "updated": "2013-01-16T05:56:26.000+0000" }, { "id": "259178", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Added support for BroadcastIntent\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4412", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-06-24T16:36:46.000+0000", "updated": "2013-06-24T16:36:46.000+0000" }, { "id": "263854", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Updated the description with test case", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-07-30T02:25:40.000+0000", "updated": "2013-07-30T02:25:40.000+0000" }, { "id": "276308", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with:\r\n\r\nAppc-Studio: 3.2.0.201310181700\r\nSdk:3.2.0.v20131022171645\r\nalloy:1.2.2\r\nnpm:1.3.2\r\ntitanium:3.2.0\r\ntitanium-code-processor:1.0.3\r\nDevice:Google Nexus 7(v4.3)\r\nOS: Mac OSX 10.8\r\n\r\n\r\nGetting logs as per test code for broadcast with and without permission.\r\nAbove test code was used for testing.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-23T06:22:01.000+0000", "updated": "2013-10-23T06:22:01.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }