{ "id": "162826", "key": "TIMOB-23828", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-29T07:32:19.000+0000", "created": "2016-08-25T21:31:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios10", "qe-5.5.0", "searchquery" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [ { "id": "54013", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "165432", "key": "TIMOB-24337", "fields": { "summary": "iOS: Using Ti.App.iOS.createSearchQuery without other UserActivity API's causes build to fail on device", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-01-23T18:49:56.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": "In https://developer.apple.com/reference/corespotlight/cssearchquery, iOS 10 offers new API's for the CoreSpotlight framework. In detail, these are new attributes for the CSSearchQuery to query an attribute set by it's attribute name. \r\n\r\nProposed API:\r\n{code:javascript}\r\n// The search-query\r\nvar searchQuery = Ti.App.iOS.createSearchQuery({\r\n queryString: \"Searchable*\",\r\n attributes: [\"title\", \"displayName\", \"keywords\", \"contentType\"]\r\n});\r\n\r\n// The event to be called when a new batch of items is found\r\nsearchQuery.addEventListener(\"founditems\", function(e) {\r\n // Get found items with e.items\r\n});\r\n\r\n// The event to be called when the search-query completes\r\nsearchQuery.addEventListener(\"completed\", function(e) {\r\n // Loop through your found items and access the searchable-item attribute-set\r\n});\r\n\r\n// Start the search-query (or use searchQuery.cancel()) to abort it\r\nsearchQuery.start();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS10: Support new CSSearchQuery APIs", "creator": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 704, "state": "closed", "name": "2016 Sprint 18 SDK", "startDate": "2016-08-27T00:18:36.960Z", "endDate": "2016-09-10T00:18:00.000Z", "completeDate": "2016-09-09T20:26:13.865Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "394501", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Looks easy to expose and we can do that right next to the existing {{[Ti.App.iOS.SearchableAttributeSet|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.App.iOS.SearchableItemAttributeSet]}} etc. -I will propose an API for it later today, probably on the {{Ti.App.iOS.SearchQuery}} namespace :-)- See the proposed API above.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-26T15:17:08.000+0000", "updated": "2016-08-28T11:14:30.000+0000" }, { "id": "394568", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/8276\r\nPR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8280\r\nPR (5_5_X): https://github.com/appcelerator/titanium_mobile/pull/8281\r\n\r\nDemo:\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\nvar btn = Ti.UI.createButton({\r\n title: \"Start search-query\"\r\n});\r\n\r\nvar searchItems = [];\r\nvar itemAttr = Ti.App.iOS.createSearchableItemAttributeSet({\r\n itemContentType: Ti.App.iOS.UTTYPE_IMAGE,\r\n title: \"Titanium Core Spotlight Tutorial\"\r\n});\r\n\r\nitemAttr.contentDescription = \"Tech Example \\nOn: \" + String.formatDate(new Date(), \"short\");\r\nitemAttr.keywords = [\"Mobile\", \"Appcelerator\", \"Titanium\"];\r\nitemAttr.displayName = \"Hello world\";\r\n\r\nvar item = Ti.App.iOS.createSearchableItem({\r\n uniqueIdentifier: \"my-id\",\r\n domainIdentifier: \"com.mydomain\",\r\n attributeSet: itemAttr\r\n});\r\nsearchItems.push(item);\r\n\r\nvar indexer = Ti.App.iOS.createSearchableIndex();\r\n\r\nindexer.addToDefaultSearchableIndex(searchItems, function(e) {\r\n if (e.success) {\r\n Ti.API.info(\"Press the home button and now search for your keywords\");\r\n } else {\r\n alert(\"Errored: \" + JSON.stringify(e.error));\r\n }\r\n});\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n // An array of found Ti.App.iOS.SearchableItem's\r\n var allItems = [];\r\n\r\n // The search-query\r\n var searchQuery = Ti.App.iOS.createSearchQuery({\r\n queryString: 'title == \"Titanium*\"',\r\n attributes: [\"title\", \"displayName\", \"keywords\", \"contentType\"]\r\n });\r\n\r\n // The event to be called when a new batch of items is found\r\n searchQuery.addEventListener(\"founditems\", function(e) {\r\n for (var i = 0; i < e.items.length; i++) {\r\n allItems.push(e.items[i]);\r\n }\r\n });\r\n\r\n // The event to be called when the search-query completes\r\n searchQuery.addEventListener(\"completed\", function(e) {\r\n if (!e.success) {\r\n alert(e.error);\r\n }\r\n\r\n for (var i = 0; i < allItems.length; i++) {\r\n var attributeSet = allItems[i].attributeSet\r\n var foundTitle = attributeSet.title\r\n var foundDisplayName = attributeSet.displayName\r\n\r\n Ti.API.info(\"title: \" + foundTitle + \", displayName: \" + foundDisplayName);\r\n }\r\n });\r\n\r\n // Start the search-query (or use searchQuery.cancel()) to abort it\r\n searchQuery.start();\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-27T17:50:39.000+0000", "updated": "2016-08-29T07:27:01.000+0000" }, { "id": "394616", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "CR and FT passed! PRs merged! ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-29T07:32:04.000+0000", "updated": "2016-08-29T07:32:04.000+0000" }, { "id": "394698", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified implemented, using:\r\n\r\nMacOS 10.12 (16A239m)\r\nStudio 4.7.1.201608190732\r\nTi SDK 5.5.0.v20160829003224\r\nAppc NPM 4.2.7\r\nAppc CLI 5.5.0-5\r\nXcode 8.0 (8S201h)\r\n\r\nAble to search for and properly return indexed app content. Tested using the sample code provided and modified versions of it. Searches return the correct information when searching through zero, one, or several apps who's content has been indexed previously.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-29T21:25:22.000+0000", "updated": "2016-08-29T21:25:22.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }