Georg
Georg

Reputation: 3920

NSExtensionActivationRule for iOS app extension that can share everything

I implemented a Share-Extension that works find with all sorts of things that you want to share. So I want my user to be able to share URLs, Text, Images, Videos, Any other files and even combinations of that (like from the notes app with text and a scribble).

Everything worked fine cause I didn't know about the NSExtensionActivationRule and by default it was set to TRUEPREDICATE. But as the compiler warns me, that that is not allowed, I need to change that.

I tried setting it to all kinds of combinations of values that might go there (https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/SystemExtensionKeys.html#//apple_ref/doc/uid/TP40014212-SW10), but I just can't figure out what I need to put there, to just accept everything. Like f.e. the Slack extension... Do I need a subquery? If so, does anybody have the "Take everything"-Subquery handy?

The NSExtensionActivationUsesStrictMatching set to 2 also doesn't help.

Upvotes: 3

Views: 3489

Answers (1)

Artiom
Artiom

Reputation: 588

Try this post iOS AppExtension : How can I Combine NSExtensionActivationRule and NSPredicate

Combining Subquery with keys to a UTI NSExtensionActivationRule:

  • NSExtensionActivationSupportsFileWithMaxCount to "public.file-url"
  • NSExtensionActivationSupportsMovieWithMaxCount to "public.movie"
  • NSExtensionActivationSupportsText to "public.text"
  • NSExtensionActivationSupportsWebURLWithMaxCount to "public.url"

Upvotes: 3

Related Questions