---
title: SMSService
framework: TelephonyMessagingKit
role: symbol
role_heading: Class
platforms: [iOS 26.0+]
path: telephonymessagingkit/smsservice
---

# SMSService

A class that provides an interface for performing SMS operations.

## Declaration

```swift
final class SMSService
```

## Mentioned in

Creating a carrier messaging app

## Overview

Overview Use the TelephonyMessagingSession property smsService to get an instance of this class. You can then monitor the incomingMessageNotifications asynchronous sequence to receive notifications of incoming messages, and the sendMessage(_:) method to send outgoing messages. The following example shows how to send an SMS message with the first service found in the session’s cellularServices array. import TelephonyMessagingKit

let service = TelephonyMessagingSession.shared.smsService

let cellularServices = try session.cellularServices let cellularServiceID = cellularServices[0].id

guard service.isViable(for: cellularServiceID) else { return }

let message = SMSMessage(     cellularServiceID: cellularServiceID,     handle: SMSHandle(phoneNumber: SAMPLE_PHONE_NUMBER),     messageID: SMSMessageID(rawValue: SAMPLE_MESSAGE_ID),     content: SMSContent(body: "Hello there.") )

try await service.sendMessage(message) To receive messages, iterate over the incomingMessageNotifications asynchronous sequence, and retrieve messages from each notification as it arrives, as shown below: import TelephonyMessagingKit

let service = TelephonyMessagingSession.shared.smsService

let incomingMessageNotifications = try service.incomingMessageNotifications Task {     for await notification in incomingMessageNotifications {         let receivedMessage = notification.message         // Process receivedMessage.     } }

## Topics

### Determining service viabililty

- [isViable(for:)](telephonymessagingkit/smsservice/isviable(for:).md)
- [viabilityNotifications](telephonymessagingkit/smsservice/viabilitynotifications.md)
- [SMSService.ViabilityNotification](telephonymessagingkit/smsservice/viabilitynotification.md)

### Sending messages

- [sendMessage(_:)](telephonymessagingkit/smsservice/sendmessage(_:).md)
- [SMSMessage](telephonymessagingkit/smsmessage.md)

### Receiving messages

- [incomingMessageNotifications](telephonymessagingkit/smsservice/incomingmessagenotifications.md)
- [SMSService.IncomingMessageNotification](telephonymessagingkit/smsservice/incomingmessagenotification.md)

### Handling critical state changes

- [criticalMessageStateNotifications](telephonymessagingkit/smsservice/criticalmessagestatenotifications.md)
- [SMSService.CriticalMessageStateNotification](telephonymessagingkit/smsservice/criticalmessagestatenotification.md)

### Reporting spam

- [reportSpam(_:)](telephonymessagingkit/smsservice/reportspam(_:).md)

### Handling errors

- [SMSService.Error](telephonymessagingkit/smsservice/error.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Using Short Message Service (SMS)

- [smsService](telephonymessagingkit/telephonymessagingsession/smsservice.md)
