title: Action Extension to Handle Images From Safari
body: <p>I've got an iOS action extension that should support opening images and URLs (specifically webpages). However, the action extension does not appear in the list of available extensions when sharing an image from within Safari. For example, visiting <a href="https://en.wikipedia.org" rel="nofollow">https://en.wikipedia.org</a> and tapping the share icon will display my action extension, but visiting <a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png" rel="nofollow">https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png</a> and tapping the share icon will not. I can also enter the Photos app and selected 1 or more images to share, which will show my action extension as an option. I first tried my Info.plist file as follows:</p>
  
  <pre><code>&lt;key&gt;NSExtension&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;NSExtensionAttributes&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSExtensionActivationRule&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;NSExtensionActivationSupportsWebURLWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsImageWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>I would expect this to accept an unlimited number of images and URLs from all apps via the action extension in the share sheet. However, this is not the case; the action extension is not shown when tapping the share icon on an image. I have gone as far as adding all of the values for the <code>NSExtensionActivationRule</code> key, as follows:</p>
  
  <pre><code>&lt;key&gt;NSExtension&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;NSExtensionAttributes&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSExtensionActivationRule&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;NSExtensionActivationSupportsMovieWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsFileWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsAttachmentsWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsWebPageWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsWebURLWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
              &lt;key&gt;NSExtensionActivationSupportsImageWithMaxCount&lt;/key&gt;
              &lt;integer&gt;-1&lt;/integer&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>However, this still does not fix the issue. Is this something I would have to use the predicates for? If so, how and why?</p>