Registering an application to open from the Safari dialog "share" or "open in ..." does not work. (although it works from other applications)

I am trying to register my application for display in the Safari "Open-in ..." dialog when the user clicks the sharing button on any html web page.

I have added the content types public.html (and public.data for good measure) to the document types in Xcode, as suggested in many answers: (see this question , this question, or this apple documentation .)

And it looks like it will work. If I open .pdf in Safari, I will open the "Open in my application" dialog box at the top. I can also use the "open in ..." dialog from other applications to share the document with my application.

To test this, I built DocInteraction as recommended in this answer , and if I create an html file, my application will appear in the sharing dialog.

However, my application still does not appear in the sharing dialog in Safari. When I run it in iOS7 on iOS Simulator, I only get Mail, Twitter and Facebook:

No sign of My App anywhere!

The same thing happens when I test it on my real iOS device:

Sad Safari can't find My App

BUT, I would like you to notice that this seems possible! Take a look at the screenshot above .. At the same time, Weibo has dealt with this feat. I don’t know how, but for some reason Weibo appears on this list, although My App does not.

And you know, in fact, that makes sense, considering how many applications can open html pages. Here DocInteraction works on my iOS device, trying to split the html page:

Everybody wants some of the .html action!

Here it is! My app! (This is actually called "Wulu Podify"). But there are so many applications that crave .html pages, I think Safari thinks it can be a little overwhelming to provide them all.

BUT, this still begs the question, how did Weibo get on this list? But, some further digging seems to show that, in fact, Weibo seems to be on EVERY list.

What can't weibo open?

I’m not sure how they succeeded, but maybe they are going about it differently.

Weibo "I-will-open-any-document-you-throw-at-me-c'mon-try-it-c'mon" can solve this problem, but it is not ideal. I really only want to open html pages.

So. I think my questions are three times:

  • Is there a way to show my application in the Safari "Open in ..." dialog box?
  • If not, how can I achieve what Weibo has accomplished and display in ALL dialogs?
  • Should I do this? Sounds like this might be a bad idea.

Thanks for any help! I have been on this for a while!


Update:

So, in fact, I did not understand this, but I think that Weibo can be a built-in option, like Facebook and Twitter. I assumed that he was there because I installed it on my phone, but maybe it was one of the default values ​​for iOS6. I say this because when I test the iOS6.0 sim, I suddenly see that Weibo appears on the sharing screen, although I definitely did not install it on my simulator.

Weibo for all!:( Sad face.

So there may be no way around this except that it was built into Safari by an apple.

+6
source share
3 answers

I know this is many years later, but if someone comes across this old question, with iOS 8, Apple now allows application creators to make β€œextensions” that allow you to add an application to the sharing menu.

Here are some documents:

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html

+4
source

I'm afraid you do not want.

There is a difference between the Share dialog box and the Open with dialog box.

For the latter, you can register your application with interaction with the document, but the Share dialog contains only native types (which Weibo is one of them - see here: UIActivityViewController ).

Also see this question in StackOverflow: is-it-possible-to-add-an-app-to-the-native-share-dialog

+3
source

it, called extension, fist, creates a new project and β†’ file β†’ new β†’ target β†’ Application Extension β†’ ####

and select the desired extension and do ....

+1
source

Source: https://habr.com/ru/post/954569/


All Articles