Framework

IdentityLookup

Create an app extension that identifies and filters unwanted SMS and MMS messages while preserving user privacy.

Overview

When a user receives an SMS or MMS message from an unknown sender, the Messages app can ask your Message Filter app extension to determine whether the message is unsolicited or otherwise unwanted. Your app extension can make this determination by using its own built-in data and logic or by deferring to analysis done by your associated server.

To find out if a message from an unknown sender is unwanted, the Messages app launches the currently enabled Message Filter app extension and queries it, as shown in Figure 1.

Figure 1

Passing a query to a Message Filter app extension to get the status of a message

A diagram that shows the communication flow from Messages to a Message Filter app extension

The Messages app uses an ILMessageFilterQueryRequest object to pass information about the message to your Message Filter app extension. If your app extension can determine whether the message is unwanted, it returns its decision to Messages in an ILMessageFilterQueryResponse object.

If your app extension can't make this determination by itself, it tells Messages to send the information about the message to a server associated with your app. Your server examines the message information and sends a response to Messages, which passes the response to your app extension. The app extension parses the server's response and returns the final decision to Messages in an ILMessageFilterQueryResponse object, as shown in Figure 2.

Figure 2

Passing a query to an app's associated server to get the status of a message

A diagram that shows the communication flow from Messages to a Message Filter app extension and between Messages and the app's associated server

Topics

First Steps

Creating a Message Filter App Extension

Create an app extension that helps identify unwanted messages.

App Extension

class ILMessageFilterExtensionContext

The extension context for a Message Filter app extension.

class ILMessageFilterExtension

The abstract base class for the principal class of a Message Filter app extension.

Queries

class ILMessageFilterQueryRequest

A request for a Message Filter app extension to determine the status of a message received from an unknown sender.

protocol ILMessageFilterQueryHandling

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

Responses

class ILMessageFilterQueryResponse

A response to a message filter query request.

class ILNetworkResponse

A response to an HTTPS network request performed on behalf of a Message Filter app extension.

enum ILMessageFilterAction

An action to take in response to a received message.

Errors

struct ILMessageFilterError

An error type that indicates problems with network requests and responses related to IdentityLookup APIs.