[TIMOB-20183] iOS: Ti.App.getArguments failing after opening app from spotlight Search
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-01-11T18:26:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.4.0 |
Components | iOS |
Labels | ios |
Reporter | Cristian vasquez |
Assignee | Srikanth Sombhatla |
Created | 2015-12-29T03:52:08.000+0000 |
Updated | 2016-07-28T22:07:18.000+0000 |
Description
*Description:*
When 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.
*The Error:*
This error happens if I try to access Ti.App.getArguments() from any point in the app:
[ERROR] 2015-12-21 18:23:50.839 Civico[21446:1435686] -[NSUserActivity boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x7fef2a700b50
[ERROR] Script Error {
[ERROR] column = 54;
[ERROR] line = 116;
[ERROR] message = "-[NSUserActivity boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x7fef2a700b50";
[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";
[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";
[ERROR] }
*To reproduce:*
1) 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.
2) Close the app
3) Perform a search and open one item.
4) Whatch the app crash.
*Relevant Environment data:*
Appcelerator Command-Line Interface, version 5.1.0
Operating System
Name = Mac OS X
Version = 10.10.5
Architecture = 64bit
# CPUs = 4
Memory = 4.0GB
Node.js
Node.js Version = 0.12.5
npm Version = 2.11.2
Titanium CLI
CLI Version = 5.0.5
node-appc Version = 0.2.31
Titanium SDKs
5.1.1.GA
Version = 5.1.1
Install Location = /Users/cristianv/Library/Application Support/Titanium/mobilesdk/osx/5.1.1.GA
Platforms = android, mobileweb, iphone
git Hash = e46100b
git Timestamp = 11/24/15 11:07
node-appc Version = 0.2.32
Xcode
7.2 (build 7C68) - Xcode default
Install Location = /Applications/Xcode.app/Contents/Developer
iOS SDKs = 9.2
iOS Simulators = 9.2
Watch SDKs = 2.1
Watch Simulators = 2.1
Supported by TiSDK 5.1.1.GA = yes
EULA Accepted = yes
Teams = none
PR https://github.com/appcelerator/titanium_mobile/pull/7614
[~apetkov] Here is the app.js containing only the relevant test case in js. Steps to test 1. Launch app and select Add item. This will add an item to spotlight search. 2. Kill app and relaunch by searching the term 'guitar' from spotlight search. You should see the continue activity details as an alert. 3. Now select Access Args, this should show the launch args as expected. In case to debug in Xcode, after step 2 xcode->debug->Attach to Process and select the app process. Do this before step 3.
The PR posted above fixes the issue I linked to.
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. Tested on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-36 Arrow: 1.8.2 SDK: 5.4.0.v20160727143921 Node: v4.4.7 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Device: iphone 6 plus (9.1)