Sunday, January 31, 2016

Adding Meta data to the NSUserActivity

NSUserActivity gives specific mentioning to the below properties 

1. eligibleForPublicIndexing 
2. expirationDate 
3. webPageURL 

Activities are private by default. When we set the eligibleForPublicIndexing, and we use the web markup to make the related website content searchable, user engagement with the item can help improve the ranking of website. 

If we don’t use the expiration date property, system will choose an expiration date.
activities are private by default. when we set an items eligibleForPublicIndexing property and we use web markup to make our related website content searchable, user engagement with the item can help ranking of our websites content. 

the webPAgeURL property is useful when the app content is also available on the website and use both NSUserActivity API in the app and the web markup for the website. In particular, we can use the webURL property to avoid duplicate indexing of the same content/ When we use the webURL property, we also require to set the requiredUserInfo property, using the keys of the userInfo dictionary that must be stored. If we don’t set the requiredUserInfoKeys property, the userInfo dictionary will be empty when the activity is restored. 

When the user performs an activity or enters the app state associated with NSUserActivity object we created, app should call becomeCurrent method to mark the activity as current. A current activity that is eligible for search is automatically added to the privat on-device index (that is CSearchableIndex). Additionally we can enable user actions within a search result such as calling a number or getting directions to a location.
If we want the activity to be eligile for search but not for handoff between devices, set eligibleForSearch property to true and eligileForHandoff property to false. 

references:


No comments:

Post a Comment