Preparing your app to be the default messaging app
Configure your messaging app so people can set it as the default on their device.
Overview
In iOS and iPadOS 18.2 and later, a person may select an app other than the Messages app to send instant messages. If your app provides messaging services and you wish to optionally become the default messaging app, there are several steps you need to take.
Add the Default Messaging App entitlement to your project
Add the com.apple.developer.messaging-app entitlement to the .entitlements file in your app’s Xcode project. For instructions on how to add this entitlement, see Default Messaging App.
Add the instant messaging (im:) URL type support and URL scheme to your app’s Info.plist and Xcode project
Add the im: support to your app’s Info.plist file, following these steps:
In your app’s Xcode project, select the
Info.plistfile in the File Navigator.Open the URL Types array (or add the array, if necessary, by creating a new entry and selecting URL Types from the dropdown menu).
Add a new URL scheme to the URL Types array, and set its string value to
im.
Next, in order for your app to open incoming im: URLs, it needs to support this as a custom URL scheme.
To add this support, see Defining a custom URL scheme for your app.
Process incoming messaging URLs in your app
You can process incoming messages using either scene(_:openURLContexts:) delegate method or the UIApplication delegate method application(_:open:options:).
Provide fallback behavior in your app
In cases where your app can’t handle the provided phone number, you can configure a fall back to the system to deliver with the Messages app, if it’s installed. Your app can do this by reformatting the incoming im: URL to a sms: URL, then forwarding it using the open(_:options:completionHandler:) method.