Can you open apps within other apps, with no URL scheme? - iphone

Is it possible to open another app, like Camera, from a third-party app? I know there are URL schemes - http://wiki.akosma.com/IPhone_URL_Schemes - but I just want to open an app, not send any data to the app.

Unfortunately, no. Launch Services is private API on the iPhone. You application can launch another app only through trying to open a URL registered by that app or a file document the app understands. However, as far as I know, your app has no control over or knowledge about which app exactly will handle the URL or the file.

One way to fire up the camera from within your app, of course, is the UIImagePickerController class.
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
It's not quite what you're asking, but it might be as close as you're going to get.

Related

iPhone: Access Camera and Album from Web app

I want to develop a web app using html5, js. One of the feature is to launch device Camera and record video, take a picture and access photo album. Is it possible to access via web app if i develop? I saw in the forums that, it is saying not possible in some places and it is possible in some places. I would like to know, is it really possible to access directly camera and album etc. ?
Please suggest!
Thank you!
It's not possible to access phone camera using Web app, as the "Web APP" typically runs in the browser of device.
Though there are some frameworks (like Phonegap) allows you to embedd your web app into native container. With this approach and added libraries from such framework you can access some of those native API's and Device Hardware.
One Possible solution is,
Create one app and distribute it using app store
using your webapp, you can connect to above app using url-scheme
http://code.google.com/p/iphone-photo-picker/
go to above link, where you can find complete code for it.

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.

opening a native app from a webapp

I was wondering if it's possible to achieve some sort of thing?
I have a web app, and for example - I want it to run facebook native app, is it possible?
You could use a custom URL scheme for your app.
See this question iPhone/iPad URL Custom Scheme to open a file

Using another one application in one Iphone Application?

anytutorial to use good reader application in iphone sdk?
can I use Good reader application in my Iphone APplication?
To launch another application you have to find out if they have published a protocol to use and then 'open' that URL. See example, but not sure if GoodReader has published a protocol or how to find out if they have. You could always contact the developer directly.
You can't access another applications Sandbox or start another application via code, otherwise Apple will reject the app. I stand corrected to the answer about URL schemes to launch another app. You learn something new everyday.
You [can also] build the PDF functionality into your own app (i.e. use a UIWebView to do that for you).

iPhone - Open Application from Web Page

This sounds odd. In fact, it sounds like a security risk to me. However, I would swear that I have seen web pages that you can click a link on and it opens the app store on the iPhone.
My question is, is it possible to launch any application from through a web page? Can parameters be passed to the application? I do not need technical details. I'm just curious if it is possible.
Thank you,
Yes. From Control and configuration of applications through Info.plist - Invoking your iPhone application by URL:
Invoking your iPhone application by URL
The CFBundleURLTypes key allows you to specify URL schemes that will cause the iPhone to switch to your application. No, you can't override the schemes for the built-in applications.
If your application is launched using a URL type named scheme, then you can also provide a different startup image "Default-scheme.png" instead of the regular "Default.png".
See iPhone file extension app association for more details.