{ "id": "151399", "key": "TIMOB-19640", "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": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2015-10-01T18:10:34.000+0000", "created": "2015-09-22T22:06:24.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios9", "spotlight" ], "versions": [], "issuelinks": [], "assignee": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-10-14T16:41:15.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": "Im using .isSupported() to check if my iOS8.3 device should create indexs for Spotlight search. However, the isSupported call throws an error\r\n\r\nCode to test with (modified version from the Spotlight search sample app):\r\n\r\n\t// Create an instance of the index\r\n\tvar searchableIndex = Ti.App.iOS.createSearchableIndex();\r\n\r\n\t// Check if Spotlight is supported (since iOS 9)\r\n\tif (searchableIndex.isSupported()) {\r\n\t\talert('You have iOS9 Spotlight Search');\r\n\t}\r\n\r\nError I am given when used on the actual device:\r\n\"undefined is not an object (evaluating 't.isSupported')\"", "attachment": [], "flagged": false, "summary": "iOS9 Spotlight Search isSupported function doesn't work on pre-iOS9 devices", "creator": { "name": "ch", "key": "ch", "displayName": "Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ch", "key": "ch", "displayName": "Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.10.5\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 0.10.32\r\n npm Version = 1.4.28\r\nTitanium CLI\r\n CLI Version = 5.0.3\r\nTitanium SDK\r\n SDK Version = 5.1.0.v20150917080109\r\n SDK Path = /Users/c/Library/Application Support/Titanium/mobilesdk/osx/5.1.0.v20150917080109\r\n Target Platform = iphone\r\n\r\nDevice: iPhone 5c with iOS 8.3", "closedSprints": [ { "id": 494, "state": "closed", "name": "2015 Sprint 20 SDK", "startDate": "2015-09-26T00:29:19.845Z", "endDate": "2015-10-10T00:29:00.000Z", "completeDate": "2015-10-12T05:33:30.964Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "365566", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Im sorry your having issued with the platform , however unless you have both Xcode 7 and an iOS 9 device the searchableIndex will never get created. As previous iOS don't support the function, also is not part of the compile library for Xcode version prior to 7. The best approach to this problem would be to check the iOS version before initializing the variable . \r\n{code} Example \r\nif (Ti.Platform.version >= 9) {\r\n\r\n\tTi.API.info('iOS 9 supported');\r\n\t// Create an instance of the index\r\n\tvar searchableIndex = Ti.App.iOS.createSearchableIndex();\r\n\t// Check if Spotlight is supported (since iOS 9)\r\n\tif (searchableIndex.isSupported()) {\r\n\t\talert('You have iOS9 Spotlight Search');\r\n\t}\r\n\telse \r\n\t{\r\n\t\t//Do something\r\n\t\tTi.API.info('The device is not iOS 9 supported');\r\n\t}\r\n}\r\n\r\n{code}", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-01T18:10:01.000+0000", "updated": "2015-10-01T18:10:01.000+0000" }, { "id": "365720", "author": { "name": "ch", "key": "ch", "displayName": "Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Angel,\r\n\r\nThats fine, I am manually checking the iOS version now,\r\n\r\nbut what is the purpose of .isSupported() then ?\r\n", "updateAuthor": { "name": "ch", "key": "ch", "displayName": "Cameron", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-03T13:15:29.000+0000", "updated": "2015-10-03T13:35:02.000+0000" }, { "id": "365724", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The searchableIndex.isSupported() method just checks if your currently on Xcode 7, if you are it returns a message saying your device is supported.However unless you are on IOS 9 the object will never actually be created. I hope that helps. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-03T19:40:42.000+0000", "updated": "2015-10-03T19:40:42.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }