Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19356] iOS9: Providing access to SearchIdentifiers on ContinueUserActivity

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-08-28T09:10:40.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.0.0
ComponentsiOS
Labelsspotlight
ReporterBen Bahrenburg
AssigneeEric Merriman
Created2015-08-16T23:49:30.000+0000
Updated2017-03-21T20:33:20.000+0000

Description

Provide access to CSSearchableItemActivityIdentifier on ContinueUserActivity. This allows the developer to access the unique searchableItem they created while publishing to the search index.

Comments

  1. Chee Kiat Ng 2015-08-28

    PR Here: https://github.com/appcelerator/titanium_mobile/pull/7081
  2. Chee Kiat Ng 2015-08-28

    CR and FT passed. approved and merged PR. Sample code:
       var searchItems = [];
       var itemAttr = Ti.App.iOS.createSearchableItemAttributeSet({
           itemContentType:"public.image",
           title:"Titanium Core Spotlight Tutorial",
           contentDescription:"Tech Example \nOn: " + String.formatDate(new Date(),"short"),
           keywords:["Mobile","Appcelerator","Titanium"]
       });
       
       var item = Ti.App.iOS.createSearchableItem({
           identifier:"my-id",
           domainIdentifier:"com.mydomain",
           attributeSet:itemAttr
       });
       searchItems.push(item);
       
       var indexer = Ti.App.iOS.createSearchableIndex();
       
       indexer.addToDefaultSearchableIndex(searchItems,function(e){
           if(e.success){
               alert("Press the home button and now search for your keywords");
           }else{
               alert("Errored: " + JSON.stringify(e.error));
           }
       });
       
       Ti.App.iOS.addEventListener("continueactivity",function(e){
           //console.log(JSON.stringify(e));
           alert(JSON.stringify(e));
       });
       

    steps to test

    1. launch app with sample code 2. exit app, in spotlight key in the keywords like 'titanium' 3. select the corresponding app result

    Expected Result

    App should open with message dialog containing information of the search item. [~bhatfield] please consider this for the spotlight docs.
  3. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source