Is it possible to launch any arbitrary iPhone application from within another app?, For example in my application if I want the user to push a button and launch right into the Phone app (close the current app, open the Phone app).
would this be possible? I know this can be done for making phone calls with the tel URL link, but I want to instead just have the Phone app launch without dialing any specific number.
You can only launch apps that have registered a URL scheme. Then just like you open the SMS app by using sms:, you'll be able to open the app using their URL scheme.
There is a very good example available in the docs called LaunchMe which demonstrates this.
LaunchMe sample code as of 6th Nov 2017.
In order to let you open your application from another, you'll need to make changes in both applications. Here are the steps using Swift 3 with iOS 10 update:
1. Register your application that you want to open
Update the
Info.plist
by defining your application's custom and unique URL Scheme.Note that your scheme name should be unique, otherwise if you have another application with the same URL scheme name installed on your device, then this will be determined runtime which one gets opened.
2. Include the previous URL scheme in your main application
You'll need to specify the URL scheme you want the app to be able to use with the
canOpenURL:
method of theUIApplication
class. So open the main application'sInfo.plist
and add the other application's URL scheme toLSApplicationQueriesSchemes
. (Introduced in iOS 9.0)3. Implement the action that opens your application
Now everything is set up, so you're good to write your code in your main application that opens your other app. This should looks something like this:
Note that these changes requires a new release if you want your existing app (installed from AppStore) to open. If you want to open an application that you've already released to Apple AppStore, then you'll need to upload a new version first that includes your URL scheme registration.
No it's not. Besides the documented URL handlers, there's no way to communicate with/launch another app.
The lee answer is absolutely correct for iOS prior to 8.
In iOS 9 you must whitelist any URL schemes your App wants to query in Info.plist under the LSApplicationQueriesSchemes key (an array of strings):
Here is a good tutorial for launching application from within another app:
iOS SDK: Working with URL Schemes
And, it is not possible to launch arbitrary application, but the native applications which registered the URL Schemes.
Swift 3 quick and paste version of @villy393 answer for :