Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to delete user activities/spotlight indexed items #196

Open
marcpalmer opened this issue Sep 9, 2018 · 0 comments
Open

Add a way to delete user activities/spotlight indexed items #196

marcpalmer opened this issue Sep 9, 2018 · 0 comments

Comments

@marcpalmer
Copy link
Contributor

marcpalmer commented Sep 9, 2018

By specifying an app-unique persistentIdentifier on activities, the NSUserActivity instances can be deleted from the system's database. For example if you delete a document, activities related to it should be removed to avoid frustrating results.

Currently persistentIdentifier must be set manually, but we could:

  • Automatically generate an ID based on the action type name (though this might change over time... so should default to this but allow supplying a specific value by convention not just for use with this feature - uniqueIdentifier?) plus some hash or representation of the input
  • Add a deleteActivity(forInput:x) call on Action that will recreate this same ID and call deleteSavedUserActivitiesWithPersistentIdentifiers

The latter, plus the nuclear deleteAllSavedUserActivitiesWithCompletionHandler are the only options available, so I don't think there's more we can do in convention terms related to actions.

See https://developer.apple.com/documentation/sirikit/deleting_donated_shortcuts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant