# Telephony

{% hint style="danger" %}

### Thank you for checking out the Telephony plugin. Unfortunately, this plugin is no longer actively maintained.

{% endhint %}

{% hint style="success" %}
[Check out on GitHub](https://github.com/shounakmulay/Telephony) &#x20;
{% endhint %}

**This plugin currently only works on Android Platform**

A Flutter plugin to use telephony features such as

* Send SMS Messages
* Query SMS Messages
* Listen for incoming SMS
* Retrieve various network parameters

This plugin tries to replicate some of the functionality provided by Android's [Telephony](https://developer.android.com/reference/android/provider/Telephony) class.

Check the [Features section](#features) to see the list of implemented and missing features.

{% hint style="danger" %}

#### Telephony deals with features that require high risk or sensitive permissions.

Make sure that your app complies with the requirements of Google Play.\
\--> [https://support.google.com/googleplay/android-developer/answer/9214102](https://support.google.com/googleplay/android-developer/answer/9214102?hl=en)\
\--> <https://support.google.com/googleplay/android-developer/answer/9888170>
{% endhint %}

### Usage

To use this plugin add `telephony` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/packages-and-plugins/using-packages).

### Get Started

#### Setup

Import the `telephony` package

```dart
import 'package:telephony/telephony.dart';
```

Retrieve the singleton instance of `telephony` by calling

```dart
final Telephony telephony = Telephony.instance;
```

### Features

* [x] [Send SMS](https://telephony.shounakmulay.dev/sending-an-sms)
* [x] [Query SMS](https://telephony.shounakmulay.dev/query-sms)
  * [x] [Inbox](https://telephony.shounakmulay.dev/query-sms#getinboxsms)
  * [x] [Sent](https://telephony.shounakmulay.dev/query-sms#getsentsms)
  * [x] [Draft](https://telephony.shounakmulay.dev/query-sms#getdraftsms)
* [x] [Query Conversations](https://telephony.shounakmulay.dev/query-conversations)
* [x] [Listen to incoming SMS](https://telephony.shounakmulay.dev/listen-incoming-sms)
  * [x] When app is in foreground
  * [x] When app is in background
* [x] [Network data and metrics](https://telephony.shounakmulay.dev/network-data-and-metrics)
  * [x] [Cellular data state](https://telephony.shounakmulay.dev/network-data-and-metrics#cellulardatastate)
  * [x] [Call state](https://telephony.shounakmulay.dev/network-data-and-metrics#callstate)
  * [x] [Data activity](https://telephony.shounakmulay.dev/network-data-and-metrics#dataactivity)
  * [x] [Network operator](https://telephony.shounakmulay.dev/network-data-and-metrics#networkoperator)
  * [x] [Network operator name](https://telephony.shounakmulay.dev/network-data-and-metrics#networkoperatorname)
  * [x] [Data network type](https://telephony.shounakmulay.dev/network-data-and-metrics#datanetworktype)
  * [x] [Phone type](https://telephony.shounakmulay.dev/network-data-and-metrics#phonetype)
  * [x] [Sim operator](https://telephony.shounakmulay.dev/network-data-and-metrics#simoperator)
  * [x] [Sim operator name](https://telephony.shounakmulay.dev/network-data-and-metrics#simoperatorname)
  * [x] [Sim state](https://telephony.shounakmulay.dev/network-data-and-metrics#simstate)
  * [x] [Network roaming](https://telephony.shounakmulay.dev/network-data-and-metrics#isnetworkroaming)
  * [x] [Signal strength](https://telephony.shounakmulay.dev/network-data-and-metrics#signalstrengths)
  * [x] [Service state](https://telephony.shounakmulay.dev/network-data-and-metrics#servicestate)
* [x] Start Phone Call
* [ ] Schedule a SMS
* [ ] SMS Retriever API


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://telephony.shounakmulay.dev/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
