iPhone app switching - iphone

Is it possible to run an iPhone app from your own app?
For example when you press a button in your app, the iPhone switches to another app.
If so, how would you do this?

Yes, but the developer of the app being switched to will have to have specified a URL protocol handler. For more information on those, look here. If it has specified a protocol handler, you can use the openURL: method to open the URL. Example (opens the Phone app and dials a number:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://123456789"]];
The easiest way to make sure this works is if you're the developer of the app being launched.

"You can register URL types for your application that include custom URL schemes. A custom URL scheme is a mechanism through which third-party applications can interact with each other and with the system. Through a custom URL scheme, an application can make its services available to other applications."
Implementing Custom URL Schemes
Take a look at "Registering Custom URL Schemes" and "Handling URL Requests"

Related

Get Safari's last redirected URL to my main UIviewcontroller

In my app, I call Safari to open (UIApplication delegate), Safari comes into foreground and there are some url redirections.
At last, there's a url that I want to save in my main application.
How can I get this url and how can I return to my main app?
Short answer: You can't. Apple does not allow 3rd party applications to access any information about recent URL's visited in Safari and so on.
You can't, because Safari is now open and your app is now closed. In addition, the iPhone is sandboxed so you are probably not allowed to access Safari's information anyway.
Instead, I would recommend instead using a UIWebview. It allows the user to access the web from inside of your app. The current URL open in the UIWebView is located at myWebView.request.URL.absoluteString;
EDIT: This is not an example of multitasking. Your program can not run in the background unless it is making a VoIP call, checking location, or receiving push notifications.

Return to app from safari

In my application, I redirect the user to the safari browser when he/she taps on a button, which in turn closes the application and opens the safari browser. There is no problem in that. It works fine. The thing is when the user quits the safari browser, I want to redirect the user back to the application, not the home screen. Any idea please...
If you control the website that you are redirecting them to, then you can place a link on the site using custom URL which I describe in more details below. But if it's a site you don't control, you can have the user surf within your app using the UIWebView.
For an iOS app, you can create custom URL schemes that your app register with the system. Then on the web page you would create a link using that custom URL. That is how Apple launches the telephone.app or the mail.app from mobile safari.
For example: Let say your app is call BigBadApp. You custom URL would be: bigbadapp:// Now, you could create a link to your app would be: Launch BigBadApp You can pass any kind of information back to your app using the custom URL and your app will handle that information in the app delegate. For iOS 4.2 and later: application:openURL:sourceApplication:annotation:. The name of old delegate on earlier version of iOS is application:handleOpenURL:
For more information see check Apple Implementing Custom URL Schemes.
Also iOS developer:tips has a tutorial on Launching Your Own Application via a Custom URL Scheme.
You can't. When you redirect someone out of your application the only way to get back is using the task switcher or opening your application from the home screen again.
If you want to keep the user in your application you could open the web pages in a webview within your application
use UIwebViewController . that represent web link within app . so that your app wont be in back ground and add back button in navigation bar on click back button navigate to back screen . i guess it would be better
i would launch an in app browser...
this is a good uiviewcontroller subclass that has most of the browser functions already implemented. its very easy to use.
https://github.com/samvermette/SVWebViewController

Can i start a iPhone app by an iframe?

Id like, if possible, just create an App for iphone by and URL, like http://keepyourlinks.com/browser.php
my go it's to make a browser inside a browser....
possible?
Yes it is, our app uses a browser inside the native application to view a web site. We also setup encryption and session variables so that we can check if they are logged in and validate that they are on the iPhone app and not in a browser.
You can use a UIWebView in your XIB and pass it a URL.

How to launch Native App from Web app in iPhone?

I want to access TTS (Text-To-Speech) and STT (Speech-To-Text) functionality of iOS from web app. Since web app dont access ios device functions, is it possible to launch Native app from Web app?
e.g. When user wants to access TTS (e.g. Dragon Dictation), web page will launch Native app, take recording and send the recorded text to web app again.
Or we can access TTS/STT functionality right from web app?
The only native apps you can access from web apps are those with custom URL schemes set up, and the built-in ones e.g. SMS (sms://), phone (tel://), iTunes (itms://) and YouTube (http://youtube.com/watch?...).
If the apps you mention don't have their own custom URL schemes which you can use to get to them, there's no other way you can do this.
I can answer one part of your question - using the functionality of an IOS native app from a web-app;
Apps can be developed such that they respond to custom URL schemes - like, for example, the mail app responds to mailto:// and youtube responds to youtube://. Calling a URL with one of these schemes will start the IOS app - but it's entirely on the developer to code this into their application.
You could therefore in theory develop an app to get triggered from a web-app, perform an action then return to a web app after! Probably not something I would try and do though.

How Can I open another App from my app?

I have rediATM app installed on my iphone. rediATM app is free on itunes.
I want to open that app from my iphone app.
I am not able to find out the way to open it.
i am using the following code to open it but it takes me to the website.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://itunes.apple.com/au/app/rediatm-finder/id358936470?mt=8"]];
Please help.
It does not work because you are opening the download link for itunes.
If you want to open another app on your iPhone with your own app, you must find out if this app provides a custom URL scheme. If they do, you could open the app using that custom URL, but otherwise not.
Here is an example how to create a custom URL scheme for your own app Launching Your iPhone App Via Custom URL Scheme and Apple's documentation: Communicating with Other Apps