{ "id": "151013", "key": "TIMOB-19473", "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": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-09-09T00:13:38.000+0000", "created": "2015-09-07T11:20:38.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "contacts" ], "versions": [], "issuelinks": [], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-09-09T03:27:49.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": "h6.Reproduce\r\n1.Simply run the following code.\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar addButton = Ti.UI.createButton({\r\n\ttitle: \"Add Contact\",\r\n\ttop: \"100\",\r\n\tleft: \"100\"\r\n});\r\naddButton.addEventListener('click', function() {\r\n\taddToDeviceContacts('Lorem', 'Ipsum');\r\n});\r\nwin1.add(addButton);\r\n\r\nvar searchButton = Ti.UI.createButton({\r\n\ttitle: \"Search Contact\",\r\n\ttop: \"300\",\r\n\tleft: \"100\"\r\n});\r\nsearchButton.addEventListener('click', function() {\r\n\tvar flag = searchPhoneBookContact('Lorem', 'Ipsum');\r\n\tif (flag == true) {\r\n\t\talert(\"Contact Available\");\r\n\t} else if (flag == false) {\r\n\t\talert(\" Contact Not Available\");\r\n\t}\r\n});\r\nwin1.add(searchButton);\r\n\r\nwin1.open();\r\n\r\nfunction addToDeviceContacts(firstname, lastname) {\r\n\tif (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_AUTHORIZED) {\r\n\t\taddContact(firstname, lastname);\r\n\t} else if (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_UNKNOWN) {\r\n\t\tTi.Contacts.requestAuthorization(function(e) {\r\n\t\t\tif (e.success) {\r\n\t\t\t\taddContact(firstname, lastname);\r\n\t\t\t} else {\r\n\t\t\t\taddressBookDisallowed();\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\taddressBookDisallowed();\r\n\t}\r\n};\r\n\r\nfunction addContact(firstname, lastname) {\r\n\tvar work_address = {\r\n\t\t\r\n\t};\r\n\twork_address.Street = 'street';\r\n\twork_address.City = 'workAddress';\r\n\twork_address.Country = 'country';\r\n\r\n\tvar tempMobile = '9999988888';\r\n\tvar tempPhone = '000000000';\r\n\tvar tempEmail = 'test@gmail.com';\r\n\r\n\tvar contact = Titanium.Contacts.createPerson({\r\n\t\tfirstName : (firstname != undefined) ? (firstname) : 'FirstName',\r\n\t\tlastName : (lastname != undefined) ? (lastname) : 'LastName',\r\n\t\temail : {\r\n\t\t\twork : [tempEmail]\r\n\t\t},\r\n\t\taddress : {\r\n\t\t\twork : [work_address]\r\n\t\t},\r\n\t\tphone : {\r\n\t\t\tmobile : [tempMobile],\r\n\t\t\t\"main\" : [tempPhone]\r\n\t\t},\r\n\t\tnote : 'Saved from app'\r\n\t});\r\n\t\r\n\talert('Contact saved');\r\n}\r\n\r\nfunction searchPhoneBookContact(firstname, lastname) {\r\n\tif (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_AUTHORIZED) {\r\n\t\tvar flag = performSearchFunction(firstname, lastname);\r\n\t\treturn flag;\r\n\t} else if (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_UNKNOWN) {\r\n\t\tTi.Contacts.requestAuthorization(function(e) {\r\n\t\t\tif (e.success) {\r\n\t\t\t\tvar flag = performSearchFunction(firstname, lastname);\r\n\t\t\t\treturn flag;\r\n\t\t\t} else {\r\n\t\t\t\tTi.API.info(\"address book disallowed\");\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tTi.API.info(\"address book disallowed\");\r\n\t}\r\n}\r\n\r\nfunction performSearchFunction(firstname, lastname) {\r\n\tTi.API.info(\"Address book Allowed\");\r\n\tif (Ti.Contacts.getPeopleWithName(firstname + ' ' + lastname).length > 0) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nfunction addressBookDisallowed() {\r\n\talert('Phone book can not be accessed from this app!! Access denied');\r\n}\r\n{code}\r\n2.Click the add button to add a new contact\r\n3.Click the search button.\r\n\r\nh6.Result:\r\nApp will crash.", "attachment": [], "flagged": false, "summary": "iOS9: Ti Contact might lead to a app crash", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "iOS 9\r\nLatest SDK 5.0.0.v20150904155512\r\nStudio 4.1.2", "closedSprints": [ { "id": 481, "state": "closed", "name": "2015 Sprint 18 SDK", "startDate": "2015-08-29T00:30:25.440Z", "endDate": "2015-09-12T00:30:00.000Z", "completeDate": "2015-09-14T05:24:05.135Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "362465", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Master PR: https://github.com/appcelerator/titanium_mobile/pull/7135\r\n5_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/7136", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-08T03:21:47.000+0000", "updated": "2015-09-08T03:21:47.000+0000" }, { "id": "362604", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Approved & merged, thank you [~cng]!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-09T00:13:31.000+0000", "updated": "2015-09-09T00:13:31.000+0000" }, { "id": "362615", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The app does not crash.\r\nVerified on:\r\nMac OS 10.10.4\r\nAppc CLI NPM: 4.2.0-1\r\nAppc CLI Core: 5.0.0-45\r\nTitanium CLI: 5.0.1\r\nSDK: 5.0.0.v20150908171508\r\nAppc Studio: 4.3.0.201509031836\r\nXcode: 7 beta 6\r\niPhone6 (v9.0 b5), iPhone6 Plus (v8.3)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-09-09T03:27:49.000+0000", "updated": "2015-09-09T03:27:49.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }