{ "id": "106839", "key": "TIMOB-12133", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15104", "description": "2013 Sprint 03 API", "name": "2013 Sprint 03 API", "archived": true, "released": true, "releaseDate": "2013-02-11" }, { "id": "14813", "description": "2013 Sprint 03", "name": "2013 Sprint 03", "archived": true, "released": true, "releaseDate": "2013-02-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-02-04T22:48:47.000+0000", "created": "2012-12-20T05:09:06.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "release-note" ], "versions": [ { "id": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "27582", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "112542", "key": "DE-179", "fields": { "summary": "iOS: Groups - Add or remove contact results in crash on iPad", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "25482", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "109153", "key": "TIDOC-1005", "fields": { "summary": "APIDoc, Release Notes: Update docs to describe Contacts iOS reload event", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:01.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": "*Actual result*\r\nIf a contact record is updated in the global Address Book while the app is running in the background, Titanium.Contacts.getAllPeople() is not updated.\r\n\r\n*Expected result*\r\nWhat I suggest is to add a new method called reloadContacts() which will update the cache.\r\n\r\n*Test case*\r\n{code}var tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor : \"#fff\",\r\n\ttabBarHidden : true\r\n});\r\n\r\nvar tab1 = Titanium.UI.createTab({\r\n\ttitle : 'Tab 1',\r\n\twindow : win\r\n});\r\n\r\nvar android = (Ti.Platform.osname === 'android');\r\n\r\nvar activityIndicator;\r\nif (android) {\r\n\tactivityIndicator = Ti.UI.createActivityIndicator({\r\n\t\tmessage : 'Loading all contacts, please wait...'\r\n\t});\r\n\tactivityIndicator.show();\r\n}\r\n\r\nvar makeTable = function() {\r\n\tTi.API.info(\"Making table...\");\r\n\tvar people = Titanium.Contacts.getAllPeople();\r\n\tvar rows = [];\r\n\tfor (var i = 0; i < people.length; i++) {\r\n\t\tTi.API.info(\"People object is: \" + people[i]);\r\n\t\tvar title = people[i].fullName;\r\n\t\tif (!title || title.length === 0) {\r\n\t\t\ttitle = \"(no name)\";\r\n\t\t}\r\n\t\trows[i] = Ti.UI.createTableViewRow({\r\n\t\t\ttitle : title,\r\n\t\t\tperson : people[i],\r\n\t\t\thasChild : true\r\n\t\t});\r\n\t\trows[i].addEventListener('click', function(e) {\r\n\t\t\tvar display = Ti.UI.createWindow({\r\n\t\t\t\tbackgroundColor : 'white',\r\n\t\t\t\ttitle : e.row.person.fullName\r\n\t\t\t});\r\n\t\t\tvar top = 0;\r\n\t\t\tvar showedSomething = false;\r\n\t\t\tfor (var label in e.row.person.address) {\r\n\t\t\t\ttop += 20;\r\n\t\t\t\tvar addrs = e.row.person.address[label];\r\n\t\t\t\tfor (var i = 0; i < addrs.length; i++) {\r\n\t\t\t\t\tvar info = Ti.UI.createLabel({\r\n\t\t\t\t\t\ttext : '(' + label + ') ' + addrs[i].Street,\r\n\t\t\t\t\t\ttop : top,\r\n\t\t\t\t\t\tleft : 20,\r\n\t\t\t\t\t\theight : 'auto',\r\n\t\t\t\t\t\twidth : 'auto'\r\n\t\t\t\t\t});\r\n\t\t\t\t\tdisplay.add(info);\r\n\t\t\t\t\tshowedSomething = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!showedSomething) {\r\n\t\t\t\tdisplay.add(Ti.UI.createLabel({\r\n\t\t\t\t\ttext : 'No addresses to show'\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t\ttab1.open(display, {\r\n\t\t\t\tanimated : true\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\treturn rows;\r\n};\r\n\r\nvar tableview = Ti.UI.createTableView({\r\n\tdata : makeTable()\r\n});\r\n\r\nwin.add(tableview);\r\n\r\nif (android && activityIndicator) {\r\n\tactivityIndicator.hide();\r\n}\r\n\r\nTi.App.addEventListener(\"resumed\", function(e) {\r\n\tTi.API.info(\"Resumed\");\r\n\t\r\n\t// Reload data\r\n\ttableview.setData([]);\r\n tableview.setData(makeTable());\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.open();{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Titanium.Contacts.getAllPeople() is cached", "creator": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 2.1.4 GA, 3.0 GA\r\niOS 6", "comment": { "comments": [ { "id": "236051", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed with SDK 3.0 GA on iOS 6.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T23:35:45.000+0000", "updated": "2013-01-25T23:35:45.000+0000" }, { "id": "236531", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "For testing\n\nGo to KS->Phone->Contacts->Display People\nPick a contact and see address displayed\nBack to Display People\nSuspend KS. \nGo to contacts and edit or add the address field of the contact\nResume KS.\nEnsure that the contact displays updated address\n", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-29T23:38:57.000+0000", "updated": "2013-01-29T23:38:57.000+0000" }, { "id": "236532", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/3820", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-29T23:39:15.000+0000", "updated": "2013-01-29T23:39:15.000+0000" }, { "id": "237124", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR processing. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-04T22:48:47.000+0000", "updated": "2013-02-04T22:48:47.000+0000" }, { "id": "240132", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested using Kitchen sink app.\r\nContacts are displayed, when updated changes are reflected in the app.\r\n\r\nVerified on:\r\nDevice : iPhone 5,iOS version :6\r\nSDK version: 3.1.0.v20130227145654\r\nCLI version : 3.0.24\r\nOS : MAC OSX 10.7.5\r\nXCode : 4.5.1\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-02-28T09:41:43.000+0000", "updated": "2013-02-28T09:41:43.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }