{ "id": "154056", "key": "TIMOB-20183", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-01-11T18:26:27.000+0000", "created": "2015-12-29T03:52:08.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-07-28T22:07:18.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": "*Description:*\r\n\r\nWhen I set my app to index some content in order to use the new Spotlight Search feature, I got an error when I select an item in the search that should be open using my app, the error happens if I try to use Ti.App.getArguments() in some part of my app; code that I use for push notifications and deep linking features.\r\n\r\n*The Error:*\r\nThis error happens if I try to access Ti.App.getArguments() from any point in the app:\r\n\r\n{code:bash}\r\n[ERROR] 2015-12-21 18:23:50.839 Civico[21446:1435686] -[NSUserActivity boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x7fef2a700b50\r\n[ERROR] Script Error {\r\n[ERROR] column = 54;\r\n[ERROR] line = 116;\r\n[ERROR] message = \"-[NSUserActivity boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x7fef2a700b50\";\r\n[ERROR] sourceURL = \"file:///Users/cristianv/Library/Developer/CoreSimulator/Devices/1F81EA0F-DAC5-46B0-A9FF-1BD44DD24486/data/Containers/Bundle/Application/2BE7BB9B-6438-4C07-A314-006A879D1CC4/Civico.app/app.js\";\r\n[ERROR] stack = \"[native code]\\nresumeEvent@file:///Users/cristianv/Library/Developer/CoreSimulator/Devices/1F81EA0F-DAC5-46B0-A9FF-1BD44DD24486/data/Containers/Bundle/Application/2BE7BB9B-6438-4C07-A314-006A879D1CC4/Civico.app/app.js:116:54\";\r\n[ERROR] }\r\n{code}\r\n\r\n*To reproduce:*\r\n1) Insert Ti.App.getArguments into sample app in the alloy.js file https://github.com/appcelerator-developer-relations/appc-sample-appsearch/blob/master/app/alloy.js#L14 and run the app.\r\n\r\n2) Close the app\r\n\r\n3) Perform a search and open one item.\r\n\r\n4) Whatch the app crash.\r\n\r\n*Relevant Environment data:*\r\n{code:bash}\r\nAppcelerator Command-Line Interface, version 5.1.0\r\n\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.10.5\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 4.0GB\r\n\r\nNode.js\r\n Node.js Version = 0.12.5\r\n npm Version = 2.11.2\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\n node-appc Version = 0.2.31\r\n\r\nTitanium SDKs\r\n 5.1.1.GA\r\n Version = 5.1.1\r\n Install Location = /Users/cristianv/Library/Application Support/Titanium/mobilesdk/osx/5.1.1.GA\r\n Platforms = android, mobileweb, iphone\r\n git Hash = e46100b\r\n git Timestamp = 11/24/15 11:07\r\n node-appc Version = 0.2.32\r\n\r\nXcode\r\n 7.2 (build 7C68) - Xcode default\r\n Install Location = /Applications/Xcode.app/Contents/Developer\r\n iOS SDKs = 9.2\r\n iOS Simulators = 9.2\r\n Watch SDKs = 2.1\r\n Watch Simulators = 2.1\r\n Supported by TiSDK 5.1.1.GA = yes\r\n EULA Accepted = yes\r\n Teams = none\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Ti.App.getArguments failing after opening app from spotlight Search", "creator": { "name": "cristianvg2003@gmail.com", "key": "cristianvg2003@gmail.com", "displayName": "Cristian vasquez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "cristianvg2003@gmail.com", "key": "cristianvg2003@gmail.com", "displayName": "Cristian vasquez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.10.5 Titanium SDK 5.1.1GA", "closedSprints": [ { "id": 555, "state": "closed", "name": "2016 Sprint 1 SDK", "startDate": "2016-01-02T01:31:50.127Z", "endDate": "2016-01-16T01:31:00.000Z", "completeDate": "2016-01-18T00:52:43.848Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "373897", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/7614", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-06T09:53:59.000+0000", "updated": "2016-01-06T09:53:59.000+0000" }, { "id": "373968", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~apetkov]\r\n\r\nHere is the app.js containing only the relevant test case in js. Steps to test\r\n\r\n1. Launch app and select Add item. This will add an item to spotlight search. \r\n2. Kill app and relaunch by searching the term 'guitar' from spotlight search. You should see the continue activity details as an alert.\r\n3. Now select Access Args, this should show the launch args as expected. \r\n\r\nIn case to debug in Xcode, after step 2 xcode->debug->Attach to Process and select the app process. Do this before step 3.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"White\"\r\n});\r\n \r\nvar addItem = Ti.UI.createButton({\r\n title: 'Add item',\r\n top: '35%'\r\n});\r\n\r\nvar accessArgs = Ti.UI.createButton({\r\n title: 'Access Args',\r\n top: '50%'\r\n});\r\n \r\naddItem.addEventListener('click', function() {\r\n console.log(\"creating and adding item\");\r\n var itemAttr = Ti.App.iOS.createSearchableItemAttributeSet({\r\n itemContentType: Ti.App.iOS.UTTYPE_AUDIO,\r\n title: 'While My Guitar Gently Weeps',\r\n artist: 'The Beatles',\r\n album: 'The Beatles (White Album)',\r\n musicalGenre: 'Rock',\r\n keywords: ['love', 'sleeping', 'floor', 'sweeping']\r\n });\r\n\r\n console.log(\"itemAttr:\"+itemAttr);\r\n\r\n var item = Ti.App.iOS.createSearchableItem({\r\n uniqueIdentifier: 'beatles-white-album-lp-1-track-7',\r\n domainIdentifier: 'beatles-white-album',\r\n attributeSet: itemAttr\r\n });\r\n\r\n var indexer = Ti.App.iOS.createSearchableIndex();\r\n indexer.addToDefaultSearchableIndex([item], function(e) {\r\n if (e.success) {\r\n alert('Kill app and now search for Guitar.');\r\n } else {\r\n alert('Error: ' + JSON.stringify(e.error));\r\n }\r\n }); \r\n\r\n});\r\n\r\naccessArgs.addEventListener('click', function() {\r\n printArgs();\r\n});\r\n\r\nTi.App.iOS.addEventListener('continueactivity', function(e) {\r\n // Not launched from Spotlight\r\n if (e.activityType !== 'com.apple.corespotlightitem') {\r\n return\r\n }\r\n var uniqueIdentifier = e.searchableItemActivityIdentifier;\r\n var title = e.title;\r\n alert('continueactivity: '+JSON.stringify(e));\r\n});\r\n\r\nvar printArgs = function() {\r\n var args = Ti.App.getArguments();\r\n var argsStr = JSON.stringify(args)\r\n console.log(\"launchargs:\"+argsStr);\r\n alert(argsStr);\r\n}\r\n \r\nwin.add(addItem);\r\nwin.add(accessArgs);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-07T03:10:41.000+0000", "updated": "2016-01-07T03:10:41.000+0000" }, { "id": "381350", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2016-04-02T13:09:38.000+0000", "updated": "2016-04-02T13:09:38.000+0000" }, { "id": "384410", "author": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-01T06:42:18.000+0000", "updated": "2016-05-01T06:42:18.000+0000" }, { "id": "384412", "author": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The PR posted above fixes the issue I linked to.", "updateAuthor": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-01T06:51:20.000+0000", "updated": "2016-05-01T06:51:20.000+0000" }, { "id": "391900", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. While using the above test code, verified that the app does not crash after opening the app from spotlight search; after backgrounding and killing the app.\r\n\r\nTested on:\r\n\r\nAppc CLI NPM: 4.2.7\r\nAppc CLI Core: 5.4.0-36\r\nArrow: 1.8.2\r\nSDK: 5.4.0.v20160727143921\r\nNode: v4.4.7\r\nOS: Mac OS X (10.11.6)\r\nXcode: 7.3.1\r\nDevice: iphone 6 plus (9.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-28T22:07:10.000+0000", "updated": "2016-07-28T22:07:10.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }