How to control list of apps displayed at "Open In" at iOS - ios

As we know, at iOS, we could use UIDocumentInteractionController to display the "Open in" menu where a list of third party apps which could handle the document. User could pick one app to open the document at that app.
We are looking for if we could only display a partial list at the "Open In" menu so we could apply security control here. With UIDocumentInteractionController, somehow we didn't find a way to do this. Is this possible at iOS?

since no one is answering this question, I am going to answer myself. Based on current research, there is no way to do this at iOS 6. However at the iOS 7, there seems a new feature added to manage open in per these 2 links although I haven't got chance to look into API yet.
http://www.pcmag.com/article2/0,2817,2424581,00.asp (open in management)
http://www.maas360.com/products/mobile-device-management/apple-ios/ (Manage open in)

Related

Universal Links opened in unsupported apps, are they completely lost?

I am trying to implement Branch marketing links in my app. I want for example to be able to create a link to share with users that will route them to a particular screen in the app. I noticed from the Branch docs that for some apps the link just opens the app store and not the actual app (even if it is installed). Being based in Asia I have the feeling that most of our customers will be wanting to share the link via an unsupported app such as Line. If a user is redirected to the app store via the link and then taps “open app”, what happens? Is the link meta data lost? Does the meta data only remain if the link is opened in an app such as mail or notes?
Alex from Branch.io here:
This list in the Branch documentation gives a partial list of apps that support Universal Links, but unfortunately it is not complete. We've tried to cover the most common apps.
Line is using a custom webview (not SFSafariViewController). It doesn't support Universal Links for the initial click, but this is one of the edge cases where Branch can detect the originating app and do some custom behavior. For Line, we trigger your app's URI scheme. This means the behavior your users see when clicking a Branch link from within Line is the same as Universal Links, even though Universal Links isn't actually the protocol being used.
If you want to handle other apps where Branch doesn't have a workaround like this, you could try enabling the deepviews feature. This will cause the link to open a content preview with a button to launch the app (or forward to the App Store if not installed).
When a user with the app already installed clicks the Open button on the App Store page, all the meta data is preserved and they will still be deep linked. Branch doesn't know (or care!) what happens between when the user clicks the link and the app launches, so that gives you plenty of flexibility.
Universal Links have some restrictions - not from Branch but from Apple's implementation. One of these restrictions is Universal Links cannot be opened from SFSafariViewController.
From Branch's docs, Line is not explicitly mentioned but other popular messaging apps may be of interest. I don't have Line myself but whether Line launches websites in it's own browser or the Safari app may give you a clue.
Facebook Messenger - works conditionally
WeChat - works conditionally
Twitter - works conditionally
LinkedIn - works conditionally
Any app using SFSafariViewController - works conditionally

"Open in" feature in UIActivityViewController

I need your help with UIActivityViewController.
I need to present activity controller for the file where, except for default actions, the user will be able to open the file in other apps.
I know how to do this with UIDocumentController, which shows popover with all apps able to open the file.
But how can I show all these apps in UIActivityViewController?
P.S. This behavior can be seen in Apple Mail app, for example.
Look at TTOpenInAppActivity for a way to combine both a UIActivityViewController (for normal sharing), and an 'Open in' button on that which brings up a UIDocumentInteractionController. Pre-iOS 8, that is the best way to manage this.
The function and behavior is different between UIActivityViewController and UIDocumentController.
UIActivityViewController
Presents activities that are pre-defined, you can pass an array to select which ones should be excluded among the default ones that are presented, if you want to add more activities you have to use custom activities, unfortunately these will appear bellow the rest of the activities and even more, the icon will always be gray, your app never loses control since you can use delegates and other stuff to know what is going on on those apps. (Unless you manually make an activity which opens another app)
UIDocumentController
This one asks the system for all the registered applications for a certain file extension, many apps have registered their exclusive extensions which makes it so that this app will be the only one displayed. If you pass an image, you will see all the apps that can handle this file. When using this one your app will lose control since the other app will be opened.
What is your final objective?, If you describe it with more detail we could offer you a better solution.
From what i understand, you should see yourself what type of file the user is trying to open, and then yourself open it with the most suitable one.
Since you cant really emulate what apple is doing, you should handle this problem through your interface, offer the user to "share" or to "open with" for example.
The answer is very simple. There is no way to do it. You cannot add the apps except the defaults into the UIActivityViewControllers.
You are absolutley correct, you can acheive this through the UIDocumentInteractionController.

How does one create a "file handler" in iOS, that lets you open a URL in your app if you long press on it?

For example, if you open a PDF in Safari, you have the option to open in iBooks - I believe a number of apps have this ability.
How does one "register" the ability of your app to handle such files, and is it possible so that by "long pressing" a link in Safari, you can get the option to open the URL in your app instead of in Safari?
Yes, it is possible.
look at the documentation on "Registering the File Types Your App Supports"
here is a link: https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html
For the first part, you are going to want to take a look at Registering Your Support of File Types to add your app to the system list of apps that can open specific document types. That is handled by the system.
For the second part, I could be mistaken, but I don't believe you will be able to get that "long press" functionality as it would require changing Safari. If you control the content of the web page however, you could add a Custom URL Scheme to your app which would allow you to launch it from a web page.

Opening deep content links in native apps from mobile web

My company has an app (iOS and Android), to which the following scenarios applies. I'm trying to help point my engineers and product team in the right direction.
When one of our users clicks on a content link from one of our emails, or Tweets or Facebook posts, and they're on their mobile device, we prompt the user with a link to download our app. This is similar to what many apps do, including LinkedIn (see i.stack.imgur.com/glSgJ.png).
I imagine this is mildly effective of driving awareness and downloads of a native app, for new users who came in from social media and various web sources. However, it is not helpful at all for a user like me who already has the app!
1) clicking "No Thanks" keeps me on the mobile web (when I want to be in the native app), and
2) clicking "Download the App" takes me to iTunes App Store page for an app I already own.
SUPER ANNOYING. As a result, I have to manually open the app, and search for the content in question. I'm guessing most users don't do this. More importantly, depending on the UI/UX of the app, I may never get there!
Again, I know we are handling mobile web visits in the same way many other companies (including LinkedIn) do, but it seems we are leaving a lot of potential native app use on the table. I want our engineers to build that elusive 3rd option, "Open In App".
Spotify and Rdio have solved this very nicely. Here are deep content links (in the case of these companies, to a specific song) for the two apps respectively:
http://open.spotify.com/track/2SldBUTJSK6xz43i8DZ5r2
http://rd.io/x/QF3NK0JKWmk
If you have a moment, first grab the free version of Rdio or Spotify apps. Then, if you open those links above from an iOS device, you will see how nice the experience is, for existing native app users: Rdio has a nice "Tap to open in Rdio" link (http://i.stack.imgur.com/B7PuE.png), and Spotify's link is even more clear, "I have Spotify" (http://i.stack.imgur.com/Q3IV6.png). Both apps also include a link to download the app, for new app users. More importantly, both apps cookie the user: future visits to links (whether from email, Twitter, Facebook, etc) on mobile web automatically open the app, instead of prompting you to choose each time. SUPER CONVENIENT.
Questions:
1) How do they accomplish this? I'm initially only concerned about iOS (on which I tested this), but this same situation should apply to Android.
2) Why aren't more apps doing this? It doesn't seem like rocket science, so am I missing a key reason why this might be a bad idea? Half of my problem is convincing the use case.
3) Why don't I see discussions about this technique? I've searched a ton for an iOS solution. I come up with a lot of discussion about URL registrations (mainly app-to-app), but no one actually referring to the type of scenario I describe (mobile web prompt to open native app).
It seems that with minimal engineering, app developers could dramatically increase native app use, converting from mobile web. :)
Android supports deep linking. Please refer to
http://developer.android.com/training/app-indexing/deep-linking.html
Tapstream's deferred deep links can send users to specific views within apps (iOS only), even when the app isn't yet installed on their device.

Is there a function which lets you add functionality to an existing app on ios?

I am curious if it is possible to make an app that adds a functionality to an existing app on ipad, say safari. If yes, which function would add a button to safari?
My question is based on 2 app advertisements I saw, one added a button to safari, the other created an app itself. I didnt buy them yet, so I dont know if they really do what thet say.
Thanks
As far as I'm aware, I think the closest you get to adding functionality to an existing app would be creating a new app that allowed interaction with certain document types.
For example, you might create an app that can open and read PDF documents. On installing this app, you would then find that interacting with a PDF document on any app (such as in an email attachment, or opening a PDF in Safari) would show a new option to open the PDF in your app. This kind of interaction is achieved via the UIDocumentInteractionController class.
Beyond that, I believe you would have to create your own app from scratch based on an existing one in order to extend functionality (so, create the 'MyBrowser' app to behave like Safari, except with additional controls and features).
I'd love to be proven wrong, however.

Resources