TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How to check whether your other apps are installed

Swift version: 5.10

Paul Hudson    @twostraws   

iOS lets you check for the existence of other apps, but you do need to declare them in your Info.plist file, and you may need to provide an explanation to the App Review team if you try to query too many apps or apps that aren’t yours.

The key here is to give each of your apps a custom URL scheme. So, your first app might use “myapp1://“, your second app might use “myapp2://”, and so on. You don’t actually need to use these URLs, and they ought to be unique, so you should make them prefixed with your company name to be sure.

To try it out, right-click on your Info.plist file and choose Open As > Source Code. The file should end like this:


I’d like you to paste this XML directly before those lines:


That registers two URL schemes, “myapp1://” and “myapp2://”, with iOS, which means you can now try to read them.

With that done, you can now add code like this to check whether the system is able to respond to “myapp1://” URLs:

UIApplication.shared.canOpenURL(URL(string: "myapp1://test")!)

If that returns true it means the app responsible for “myapp1://” is installed on the system, which means you know for sure the user has that other app installed.

Note: Even though you own both apps and could easily have replicated this finding using server analytics, doing it client-side might seem sketchy to some users. Be sensible and have a clear, complete privacy policy that says exactly what you want do.

Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Available from iOS 9.0

Similar solutions…

About the Swift Knowledge Base

This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.

Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 4.5/5

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.