<!--
{
  "documentType" : "article",
  "framework" : "IdentityLookup",
  "identifier" : "/documentation/IdentityLookup/sms-and-call-spam-reporting",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "SMS and Call Spam Reporting"
}
-->

# SMS and Call Spam Reporting

Create an app extension that lets users report unwanted SMS messages and calls as junk.

## Discussion

To report SMS messages and calls as spam, the user must enable an Unwanted Communication Reporting extension, called an SMS/Call Reporting extension in the Settings app (see Settings > Phone > SMS/Call Reporting). The user can only enable one Unwanted Communication Reporting extension at a time.

In order to report calls, the user swipes left on an item in the Recents list and selects Report. For SMS messages, they press the Report Messages button when it appears in the Messages transcript. Users can also select messages by long-pressing a message and selecting additional messages, then selecting Report Messages.

When the user reports an SMS message or call, the system launches your Unwanted Communication Reporting extension. Your extension gathers additional information from the user, before deciding whether to report or block the number, as shown in the figure below.

![An illustration showing the system instantiating and displaying your view controller in response to the user reporting an SMS message or call.](images/com.apple.identitylookup/media-3012154@2x.png)

Specifically, the system:

1. Instantiates your extension’s [`ILClassificationUIExtensionViewController`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController) subclass.
2. Calls your controller’s [`prepare(for:)`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController/prepare(for:)) method and presents the controller to the user.

Use your [`ILClassificationUIExtensionViewController`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController) subclass to gather data from the user. Override the [`prepare(for:)`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController/prepare(for:)) method to configure your controller.

### Cancel or Complete the Report

The system provides a Cancel and a Done button for the controller. By default, the system disables the Done button. As soon as the user has entered all the information you require, enable the Done button by setting the view controller’s [`isReadyForClassificationResponse`](/documentation/IdentityLookupUI/ILClassificationUIExtensionContext/isReadyForClassificationResponse) property to <doc://com.apple.documentation/documentation/Swift/true>.

If the user presses the Cancel button, the system dismisses your view controller, as shown in the figure below.

![An illustration showing the user cancelling your view controller.](images/com.apple.identitylookup/media-3025730@2x.png)

If the user presses Done, the system calls your view controller’s [`classificationResponse(for:)`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController/classificationResponse(for:)) method, passing in an [`ILClassificationRequest`](/documentation/IdentityLookup/ILClassificationRequest) object (see the figure below).

![An illustration showing the user tapping the Done button after entering all the required information in your user interface.](images/com.apple.identitylookup/media-3025729@2x.png)

Override the [`classificationResponse(for:)`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController/classificationResponse(for:)) method to return a [`ILClassificationResponse`](/documentation/IdentityLookup/ILClassificationResponse) based on the data the user has entered and information about the SMS message or call from the request object.

### Choose a Response

The system takes different actions based on the response. For [`ILClassificationAction.none`](/documentation/IdentityLookup/ILClassificationAction/none), the system dismisses your view controller, but doesn’t take any other action, as shown in the figure below.

![A circle representing the System Response with a right-facing arrow that points to a rectangle representing an extension with view controller dismissed. That extension has a right-facing arrow that points to a rectangle representing an extension with Deleted for user privacy text. Below that is a dark version of the same diagram.](images/com.apple.identitylookup/media-3025747@2x.png)

For [`ILClassificationAction.reportNotJunk`](/documentation/IdentityLookup/ILClassificationAction/reportNotJunk) or [`ILClassificationAction.reportJunk`](/documentation/IdentityLookup/ILClassificationAction/reportJunk), the system generates a report based on your response’s [`action`](/documentation/IdentityLookup/ILClassificationResponse/action) and [`userInfo`](/documentation/IdentityLookup/ILClassificationResponse/userInfo) properties and then posts it to a network endpoint or sends it using an SMS message, depending on the keys specified in your extension’s `Info.plist` file.

To send a response over the network connection, you must add an associated domain to your extension. For general instructions, see <doc://com.apple.documentation/documentation/Xcode/supporting-associated-domains>. Note that you must use `classificationreport` instead of `webcredentials` when specifying the domains. You must also specify the network endpoint’s address using the `ILClassificationExtensionNetworkReportDestination` key in your extension’s `Info.plist` file.

To send your response using SMS, specify a fully qualified destination telephony number using the `ILClassificationExtensionSMSReportDestination` key in your extension’s `Info.plist` file. When your app uses this report path, the system displays the SMS message to give the user the opportunity to send or cancel the message.

When the report step is complete, the system dismisses your view controller and any view controllers related to it (see the figure below).

![A circle representing the System Response with a right-facing arrow that points to a device with Cancel or Send buttons. That device has a right-facing arrow that points to a rectangle representing an extension with a view controller with Cancel and Send buttons. That extension has a right-facing arrow that points to a rectangle representing an extension with Deleted for user privacy text. Below that is a dark version of the same diagram.](images/com.apple.identitylookup/media-3025725@2x.png)

For [`ILClassificationAction.reportJunkAndBlockSender`](/documentation/IdentityLookup/ILClassificationAction/reportJunkAndBlockSender), the system responds just like in the [`ILClassificationAction.reportJunk`](/documentation/IdentityLookup/ILClassificationAction/reportJunk) action. However, after the report step, the system presents an alert letting the user know the number will be blocked. Finally, the system blocks the SMS or call number, and dismisses your view controller as shown in the figure below.

![A circle representing the System Response with a right-facing arrow that points to a device with Cancel or Send buttons. That device has a right-facing arrow that points to another device showing Alert SMS/Call blocked text. That device has a right-facing arrow that points to a rectangle representing an extension with a view controller dismissed. That extension has a right-facing arrow that points to a rectangle representing an extension with Deleted for user privacy text. Below that is a dark version of the same diagram.](images/com.apple.identitylookup/media-3025734@2x.png)

Blocked numbers are added to the device’s Blocked Contact list. Users can manage this list in the Settings app.

Finally, to protect user privacy, the system always deletes your extension’s container after your extension terminates. For more information, see [About the iOS File System](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW12).

## Topics

### App Extension

[`ILClassificationUIExtensionViewController`](/documentation/IdentityLookupUI/ILClassificationUIExtensionViewController)

The superclass for an Unwanted Communication Reporting extension’s principal view controller.

### Communications

[`ILCommunication`](/documentation/IdentityLookup/ILCommunication)

An abstract superclass representing a message or call to the user.

[`ILMessageCommunication`](/documentation/IdentityLookup/ILMessageCommunication)

A concrete subclass representing a SMS message.

[`ILCallCommunication`](/documentation/IdentityLookup/ILCallCommunication)

A concrete subclass representing a  phone call.

### Requests

[`ILClassificationRequest`](/documentation/IdentityLookup/ILClassificationRequest)

The abstract superclass for classification requests.

[`ILMessageClassificationRequest`](/documentation/IdentityLookup/ILMessageClassificationRequest)

A classification request for SMS messages.

[`ILCallClassificationRequest`](/documentation/IdentityLookup/ILCallClassificationRequest)

A classification request for phone calls.

### Responses

[`ILClassificationResponse`](/documentation/IdentityLookup/ILClassificationResponse)

A response object that tells the system how to handle the reported communications.

[`ILClassificationAction`](/documentation/IdentityLookup/ILClassificationAction)

The actions the system can take in response to the reported communication.

### Queries

[`ILMessageFilterCapabilitiesQueryRequest`](/documentation/IdentityLookup/ILMessageFilterCapabilitiesQueryRequest)

A request to query a Message Filter extension about sharing its sub-category capabilities.

[`ILMessageFilterCapabilitiesQueryHandling`](/documentation/IdentityLookup/ILMessageFilterCapabilitiesQueryHandling)

A set of methods implemented by a Message Filter app extension to handle capabilities query requests.

### Responses

[`ILMessageFilterCapabilitiesQueryResponse`](/documentation/IdentityLookup/ILMessageFilterCapabilitiesQueryResponse)

A response to a message filter capabilities query request.

[`ILMessageFilterSubAction`](/documentation/IdentityLookup/ILMessageFilterSubAction)

Responds to a received message with a filter subaction.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)