ios - Make App Activities and States Searchable by using NSUserActivity -
following code trying implement make app activities , states searchable not able show on ios search
nsuseractivity *useractivity = [[nsuseractivity alloc]initwithactivitytype:@"com.mycompany.activity-type"]; useractivity.title = @"hello world in app search"; useractivity.keywords = [nsset setwitharray:@[@"hello",@"welcome", @"search"]]; useractivity.userinfo = @{@"id":@"com.example.state"}; useractivity.eligibleforsearch = yes; [useractivity becomecurrent];
link make question more clear.
from apple forums:
one thing has bitten few people (myself included) activity must not deallocated. if code working nsuseractivities (i.e. not using corespotlight in addition) make sure activities aren't being deallocated immediately.
in case, had code allocating nsua, setting properties on it, calling becomecurrent, object go out of scope , deallocated. if you're doing this, try tossing activity strong property see if can see results when search.
Comments
Post a Comment