Find all registered mime-types / url scheme protocols (intent filters) on iOS ( iPhone / iPad / iPod ) - iphone

I'm a mobile web developer, and I'd like to test a few iOS devices to see what mime-types and url schemes the average iOS device can accept.
On Android I'm able to install an app called PackageExplorer that lists all the "intent filters" for all the apks and lists what file mime-types (image/png, text/html, text/x-vcard) and url schemes (like geo:, tel:, sms:, mailto:, http://youtube.com) the app handles.
It would be really nice if I could tell what schemes and mime-types are supported/registered from the server or browser side on my mobile webpages, but if that's not possible, I'm looking for a display or an app in iOS to view all the registered file mime-types and url scheme protocols that the device currently supports with all it's installed apps.
How do i find all the registered scheme/mime intent filters on an iOS device?
UPDATE: I don't know if it's complete, but I found an official list of url schemes sported in mobile safari: https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html (still looking for mime-types etc.)

This information is not available per se. You can however build an app that tries out content of varying types with different content-types and look whether this displays nicely or doesn't.
We've had one situation where the content type for Powerpoint was not registered on the web server and thus UIWebView was unable to display it. It will in these cases respond with a specific error code instead of didFinishLoading. When it was fixed on the server it started working in the app as well.
A slight complication there is that the test files would have to served by a web server because fileURL-based documents don't have a content type. There webkit inside UIWebView auto-detects the file type.
Though in all likelihood this information will prove to be useless to you for a simple reason: apps can always register to open certain file types on the device. The document interaction controller can be used to hand off the opening of the content in this other app. And since this extends the number of viewable document types infinitely you can never how to have a complete list.
So what you really would want is a list of these types of files that UIWebView can display, but you have this list already, you have quoted Apple's URL in your question.

Related

Is it possible for native iOS application to interact with Safari browser?

I would like to enable interaction between a native iOS application and the Safari browser such that tapping a right click on an image on a webpage provides an option in the context menu to send the image to another custom written native iOS application for further processing and/or storage.
However, according to this article from Safari Developer Library, “Safari extensions are not currently supported on iOS”.
Is there any other alternative to achieve the above functionality?
You have multiple choices here:
You could register in your application's Info.plist file that your app known how to handle certain type of documents (see here in Apple's doc). This way when your iPhone encounters this document type, iOS will propose the user to open this document in your app; for example if you register for the PDF type and you then tap on a PDF document as an attachment in a mail, you app will be listed in the proposed menu and will then be opened with the document as a parameter.
But it seems that even if this works perfectly for any type like DOC, PDF, or even custom types, it does not work for images, which seems to be handled in a separate way by iOS :(
A simpler way would be to register, still in your application's Info.plist, any custom URL schemes. See here and below in the Apple's doc. For example when, anywhere in your iPhone (either in your own app, or in another third-party app, including Safari), it encounters URLs like "myapp://xxx/yyy/zzz", it opens your app, passing this URL as an argument. You can then do whatever you want with this URL.
The solution then is to add some code in your web page so that when the image is tapped, you ask Safari to open the URL "myimageditor://edit?url=http://www.url.of/your/image.jpg". If you registered for the "myimageeditor://" URL scheme, you app will then open with the URL in the parameters, and you then will be able to retrieve the image using the embed URL.
I think it is possible only for jailbroken devices.

Prevent Downloading of Mobile Safari Video

Via HTTP Live Streaming or any other method, is it possible to embed videos in a web page that:
Are viewable in Mobile Safari?
and
Cannot be directly downloaded? (when the user navigates to the media URL in a browser, they should not by default get a downloadable file.)
Flash and Silverlight can serve media that meet these criteria on desktop browsers. I'm wondering if there's some way to meet this criteria that is compatible with Mobile Safari, which does not support Flash or Silverlight. The media need not be impossible to rip, just difficult to download with a browser alone.
For example, on the below site, demonstrating HTTP Live Streaming, I can just open up the video URLs and do File > Save. This is what I (actually the client's legal team) would like to avoid.
http://iphone.akamai.com/
Edit: Tried to clarify my question based on responses so far.
its known fact that anything accessible to a browser is downloadable, otherwise the browser couldn't get it. most users are to busy watching the video to think about downloading it, but if they want it there get it...
#dleavitt:
As per Apple's HIG, It is a fact that an app cannot have control of the things outside its sandbox.
So as the Mobile Safari Browser is not in the sandbox of any of the iPhone/iPad apps, it cannot be controlled. You cannot modify or make any changes into its default behaviour.
So keeping it in simple words, You cannot stop downloading videos via Mobile Safari Browser as you dont have control over it.
Hope this helps you.

Android, Iphone app with JS and HTML

I have read some post about apps programming for Iphone and Android, but I have one question. Is it posible when there is a mobile website optimized for mobile phones, that I can create apps for Iphone, Android, Win 7 and Blackberry, that only statrts the browser as instance and display the mobile website? What do you think, is this ok? Do you have any ideas or examples for that kind of apps? I mean this is not an app, that should be has access to the hardware of the phone, only web app.
Thanks
Nik
This would work.
You could create an app that consists merely of a webview into which you load your content. The content could be loaded over the mobile network or be stored locally.
However most users (including yours truly) strongly dislike apps that merely present a single website to the user, because of the long delays if the content is loaded over the mobile network every time and because the UI is, in many cases, very different to what the he or she is used to from native apps.
Most users fail to see the need for a specialized app just to visit a website which they could as well keep as a favorite in their mobile browser. On the iPhone, you may even add favorite websites as icons on your homescreen, so there is no need for apps presenting a single website at all.
It's not only possible, such things are already done. One example I know of is cookd, a restaurant guide for Vienna. But there are some constraints; for example, cookd requires GPS data for the "Nearby" option; on my Android phone (HTC Legend), this is possible when I open the web page directly in the browser (the browser asks if I want to allow cookd.com to get this info); but the same webpage, running in an application that does nothing more than display the browser component, cannot do that. To fix that, they would have to build GPS reception into the app and forward this info to the browser component.
O'reilly has a fantastic article about this:
http://building-iphone-apps.labs.oreilly.com/
This is a little bit directed to iPhone only, but will give you a good overview about the topic and possibilities.

Choosing what Iphone app must open one url schema

I'm able to open a url scheme with my apps. However i can have more that one app with the same
url scheme registered so i would like let user choose the default app for the scheme.
I need to use the same scheme for all my apps. Now by default iphone uses the last app installed that can open the schema.
Have you same idea to solve my problem?
Do you know if is possible inside an app choose itself as default to open a url scheme?
I can't find the possibility to do this in generale setting of Iphone.
Thanks you
It is not supported. Here is a note from Apple documentation.
If your URL type includes a scheme
that is identical to one defined by
Apple, the Apple-provided application
is launched instead of your
application. If multiple third-party
applications register to handle the
same URL scheme, it is undefined as to
which of the applications is picked to
handle URLs of that type.
Implementing Standard Application Behaviors
A possible solution would be to have your apps connect to the your server to get a list of your apps and their supported URL schemes. You can present that list to the user and the user can select the default app.

How do I develop a Web based application in ASP.NET 3.5 that can be viewed on an iPhone 3G?

I want to develop a mobile web application using asp.net 3.5 that can be viewed on an iPhone but there is no longer a template in VS2008 to enable mobile development. Can this be done ?
the iphone uses the "regular" version of your website so developing a "mobile" version would nto accomplish what you're looking for. You should check the browser headers and redirect people to the iPhone version of your site if you detect mobile safari.
http://iphone.facebook.com/
Another option (if you're using MVC) is to have your controller detect the browser and show a different view if it catches mobile safari. This way you wouldn't need a duplicate site, just two sets of views.
A web application (via Asp.Net 3.5) would be accessible over the Internet and would be accessible via the iPhone's Safari browser. There isn't anything truly special you need for it unless you want to make a true web application for mobile devices like the iPhone and Blackberries. In that case, you are looking purely at design aspects since it's still just a website. Due to the diversity of mobile browser capabilities, you'll need to do some research to find out what is recommended for the specific mobile browsers you want to access (the BBC's website comes to mind as a good example of mobile rendering).
Ultimately, the user agent is evaluated by your system and then it renders (or redirects) appropriately. Everything else is design if you want the page to render differently for the iPhone than any other browser on the web.
If you can get your hands on a copy of .Net magazine (a.k.a. Practical Web Design in the U.S.) issue 178, there is a great article on what you need to be aware of when doing mobile development and how the iPhone's browser is a lot different than others.
The iPhone (at least mine which is the 3G version) have full support for "normal" web apps with Ajax and everything. So mostly any Ajax library would be 100% compatible with the iPhone, at least as long as the Ajax library is focusing on Open Standards and such...
[Shameless-Plug I work with Ra-Ajax]
Ra-Ajax have 100% support for iPhone except for "dragging and dropping" which interferes with scrolling on the iPhone. This means that you can use Ra-Ajax (which is an LGPL licensed and Free of Charge library for ASP.NET) to create a "normal" website which will work 100% perfectly (except for dragging and dropping, which is used in e.g. Ra-Windows etc) on the iPhone...
Even the really "advanced" stuff like our Ajax Calendar sample works flawlessly with the iPhone :)