Share extension - App not showing in share menu on first attempt since iOS 14

Something weird seems to start happening after upgrade to Xcode 12 and iOS 14.

App use to show fine in share menu option before, but suddenly it is acting weirdly and only showing on second attempt onwards.

My aim is to get web page url. Here's my share activation rule.

Code Block
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
<key>NSExtensionJavaScriptPreprocessingFile</key>
<string>fetch</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>


I have even tried on new project and added share extension with activation rule above. It also does the same, and app only show in share option from second time onwards. This issue mainly happening in Safari.

It used to work fine before iOS 14, i also didn't find anything in iOS 14 change log regarding share extension that can cause the issue. Can anyone help me pointing out where it could be wrong or some possible reason.

Thanks in advance!!!
Post not yet marked as solved Up vote post of appledelegate Down vote post of appledelegate
9.7k views

Answers

Did you get an answer on this?

no, looks like an issue with iOS 14, i see few popular also disappear at the same time.
I have the same issue, only works on second attempt of pressing the share button in Safari on iOS
This is definitely an issue and only seems to happen with Action Extensions on Safari. If you try this on Chrome the issue doesn't happen.

Here's the feedback I submitted to Apple.

URLs opened with UIApplication.shared.open that launch Safari as the default browser will not enumerate any of the action extensions that respond to URLs the first time you tap Share. If you tap Share a second time it will display the Action Extensions.
  1. Install an app or apps that have an Action Extension that responds to a URL (i.e., Dropbox, GoodNotes, ClipDish)

  2. Install and run the test app included here which calls open function.

  3. In the app, tap "Tap Me"

This will open Safari. Then:
  1. Tap the Share button

  2. browse through the list and look for Dropbox, GoodNotes or ClipDish. You won't see them.

  3. Close the share sheet

  4. Open it again.

  5. They will appear.

This just started happening in iOS 14.

If I change my default browser to Chrome this doesn't happen so I'm pretty sure it's related to Safari.

Are there any updates regarding the issue?
I've tried this on iOS 14.1 and still see the problem.

As another data point. URLs open Safari in two ways from within my app. Tapping a link from a webview opens Safari and my extension and other extensions that handle URLs work fine.

Tapping a UI element that calls UIApplication.open(URL('the url to open")) still causes the problem
Is there any solution for this?
I’m not sure if this is something for this thread, but I found out that I couldn’t share to a lot of apps, for example: Twitter, Facebook, pocket, etc.
i also couldn’t add them.

I changed my iOS 14.2 from Dutch language to English, and voila, there they were. When I switched back to Dutch, all stayed ok.

Maybe this info is useful.
  • Thank you to DVA013 mine wouldn’t work no matter how many times I press share. your fix to change language worked for me

  • Worked for me as well. Changed ITA -> ENG -> ITA and now the share sheet works fine again. I hope it's not temporary as a device restart.

Add a Comment
I can confirm this issue is still occurring for us on iOS 14.2 and is exactly as you described. Our share extension does not show up in the share sheet the first time you tap the share button. But if you dismiss the sheet and tap the share button again, then it will appear the second time. Sounds like it might be a iOS or Safari bug.

Interestingly enough a very similar bug was introduced in macOS Catalina 10.15 which was ultimately fixed in 10.15.4. With that bug, share extensions that used the NSExtensionJavaScriptPreprocessingFile key simply didn't appear at all.
Still dealing with this issue on my end - really strange as it seems to work 100% of the time when using WKWebView in-app but not in Safari.
I have the same issue, only works on second attempt of pressing the share button in Safari on iOS. Very frustrating and troublesome, please fix.
I've been having the same issue. Very odd, especially since it's been happening with multiple apps from the safari share extension.
My action extension also disappeared (not only in Safari but in all share sheets). Switching system language worked for me.
Hey, we also have this problem - any answer to this topic?
Same problem. Any updates?
  • I filed a bug report on this (via Feedback Assistant) in November 2020 and never heard thing back.

Add a Comment