{ "id": "99973", "key": "TIMOB-10684", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14126", "description": "Sprint 2012-19 Core", "name": "Sprint 2012-19 Core", "archived": true, "released": true, "releaseDate": "2012-09-24" }, { "id": "14271", "description": "2012 Sprint 19", "name": "2012 Sprint 19", "archived": true, "released": true, "releaseDate": "2012-09-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-19T11:52:58.000+0000", "created": "2012-08-28T02:50:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "module_notification_manager", "qe-testadded" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-19T11:52:58.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3. Problem description\r\nError when opening an app from local notification using Ti.App.getArguments() \r\n\r\nh3. Sample code and steps to reproduce\r\n\r\nRun the sample code.\r\nLocal notification is correctly received. When clicking on the notification, everything works fine if the app is backgrounded. If the app is closed, an error is thrown and the app is not opened (see attached error log)\r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar textArea = Ti.UI.createLabel({\r\n\ttext:'Launch Arguments: '+ Ti.App.getArguments(),\r\n\ttop:200\r\n});\r\n\r\nwin1.add(textArea);\r\n\r\nvar button = Ti.UI.createButton({\r\n\twidth:200,\r\n\theight:150,\r\n\ttitle:'Create Notification'\r\n});\r\n\r\nwin1.add(button);\r\n\r\nvar context = this;\r\nbutton.addEventListener('click', function(e){\r\n\t\r\n\tvar notificationDate = new Date(new Date().getTime() + (20*1000));\r\n\r\n\tcontext.notification = Ti.App.iOS.scheduleLocalNotification({\r\n\t\talertBody:'This is a sample notification',\r\n\t\tdate:notificationDate,\r\n\t\tsound:'/alert.caf',\r\n\t\tuserInfo : {\"reportId\":3,\"savedId\":5},\r\n\t\talertAction:'View Report'\r\n\t});\r\n\t\r\n\talert('Leave and kill this app, you will receive a notification in 60 secs');\r\n\t\t\t\t\t\r\n});\r\n\r\n\r\nwin1.open();\r\n{code}", "attachment": [ { "id": "30774", "filename": "timob10681.log", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T02:50:19.000+0000", "size": 4656, "mimeType": "text/plain" } ], "flagged": false, "summary": "iOS: Ti.App.getArguments() fails when opening the app from a local notification", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 5\r\nTiSDK tested 2.0.2 GA, 2.1.2 and 2.2 CI ", "comment": { "comments": [ { "id": "219011", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test instructions (on device):\r\n1. Launch app, press button, wait 20 secs to get text area updated with \"Notification: This is a sample notification\"\r\n2. Close and kill the app.\r\n3. Launch app again, press button, press Home, kill app.\r\n4. Wait 20 secs to on-screen notification to appear.\r\n5. Click on notification to open the app.\r\n6. Text area should be updated with \"Notification: This is a sample notification\" on start.\r\n\r\nUpdated test case:\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar textArea = Ti.UI.createLabel({\r\n text:'Launch Arguments: '+ Ti.App.getArguments(),\r\n top:100\r\n});\r\n\r\nTi.App.iOS.addEventListener('notification', function(e) {\r\n\ttextArea.text = textArea.text + \" Notification: \"+e.alertBody;\r\n}); \r\n\r\nwin1.add(textArea);\r\n\r\nvar button = Ti.UI.createButton({\r\n\twidth:200,\r\n\theight:150,\r\n\ttitle:'Create Notification'\r\n});\r\n\r\nwin1.add(button);\r\n\r\nvar context = this;\r\nbutton.addEventListener('click', function(e){\r\n\t\r\n\tvar notificationDate = new Date(new Date().getTime() + (20*1000));\r\n\r\n\tcontext.notification = Ti.App.iOS.scheduleLocalNotification({\r\n\t\talertBody:'This is a sample notification',\r\n\t\tdate:notificationDate,\r\n\t\tsound:'/alert.caf',\r\n\t\tuserInfo : {\"reportId\":3,\"savedId\":5},\r\n\t\talertAction:'View Report'\r\n\t});\r\n\t\r\n\talert('Leave and kill this app, you will receive a notification in 20 secs');\r\n\t\t\t\t\t\r\n});\r\n\r\n\r\nwin1.open();\r\n{code}", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-14T10:41:22.000+0000", "updated": "2012-09-14T13:27:01.000+0000" }, { "id": "229904", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 3.0.0.v20121130200208 on iPhone 4 5.1.1", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-04T19:39:04.000+0000", "updated": "2012-12-04T19:39:04.000+0000" }, { "id": "262457", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T11:52:12.000+0000", "updated": "2013-07-19T11:52:12.000+0000" }, { "id": "262458", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with: \r\nSDK:3.1.2.v20130718094558\r\nAppcelerator Studio: 3.1.2.201307121651\r\nOS: OSX 10.7.5\r\nDevice:iPhone5(ios6)\r\nXcode: 4.6", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T11:52:58.000+0000", "updated": "2013-07-19T11:52:58.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }