iOS development
app integration
iPhone programming
mobile app design
inter-app communication

Launch an app from within another iPhone

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

On iPhone, one app can open another app only through mechanisms that iOS explicitly allows, such as custom URL schemes, Universal Links, and a small set of documented system URL types. You cannot arbitrarily launch any installed app by bundle identifier the way you might on other platforms. The real design question is which supported handoff mechanism matches the integration you need.

Use a Custom URL Scheme for App-to-App Handoff

The classic approach is a custom URL scheme. The target app registers a scheme, and the source app opens a URL using that scheme.

In the target app, register a URL type such as myapp. In the source app:

swift
1import UIKit
2
3func openTargetApp() {
4    guard let url = URL(string: "myapp://profile?id=42") else {
5        return
6    }
7
8    UIApplication.shared.open(url, options: [:]) { success in
9        print("Opened:", success)
10    }
11}

This works only if the target app is installed and the scheme is correctly declared.

Check Availability With canOpenURL

If you want to detect whether the target app is available before opening it, use canOpenURL.

swift
1import UIKit
2
3func openIfAvailable() {
4    guard let url = URL(string: "myapp://profile?id=42") else {
5        return
6    }
7
8    if UIApplication.shared.canOpenURL(url) {
9        UIApplication.shared.open(url)
10    } else {
11        print("Target app is not available")
12    }
13}

For third-party schemes, the source app must usually declare the scheme under LSApplicationQueriesSchemes, or canOpenURL may return false even when the target app is installed.

xml
1<key>LSApplicationQueriesSchemes</key>
2<array>
3  <string>myapp</string>
4</array>

If both the app and the website are under your control, Universal Links are often a better long-term solution than custom schemes.

swift
if let url = URL(string: "https://example.com/profile/42") {
    UIApplication.shared.open(url)
}

Universal Links let the same HTTPS link open the app when installed and fall back to the website otherwise. That makes them more robust for user-facing flows and easier to share outside the app too.

System URL Types Are Special Cases

Some integrations rely on documented system URL formats, such as phone calls, maps, and mail.

swift
if let url = URL(string: "tel://1234567890") {
    UIApplication.shared.open(url)
}

These are allowed because Apple explicitly supports them. That is very different from assuming you can launch arbitrary third-party apps without the other app’s cooperation.

The Target App Must Handle the Incoming URL

Opening the app is only half the integration. The target app also has to parse the incoming URL and route the user correctly.

swift
1func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
2    guard let url = URLContexts.first?.url else {
3        return
4    }
5
6    print("Received URL:", url.absoluteString)
7}

If that handler is missing or incomplete, the source app may successfully open the target app while still failing to perform the intended action.

What iOS Does Not Allow

iOS does not let one ordinary app enumerate all installed apps, launch arbitrary bundle identifiers, or silently automate another third-party app in the background. Those restrictions are deliberate and are part of the platform’s privacy and security model.

So if your real goal is data exchange rather than app switching, look at alternatives such as share sheets, document pickers, extensions, or network APIs instead of trying to force app launching to solve everything.

Common Pitfalls

  • Assuming one iPhone app can launch any other installed app without an agreed integration mechanism.
  • Forgetting to declare queried schemes for canOpenURL checks.
  • Depending on undocumented third-party URL schemes that may disappear without notice.
  • Testing only the source app and not the receiving logic in the target app.
  • Using app launching when a share extension, Universal Link, or network API would be a cleaner design.

Summary

  • iPhone apps can open other apps only through documented, supported mechanisms.
  • Custom URL schemes are the classic app-to-app handoff pattern.
  • Universal Links are often a better choice when you control the website and app.
  • The source app must open a valid URL, and the target app must handle it correctly.
  • iOS does not allow arbitrary app launching by bundle identifier or unrestricted inter-app control.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.