Read android sms list
yarn add react-native-get-sms-list
npm i react-native-get-sms-list
Add permissions to your android/app/src/main/AndroidManifest.xml file:
<uses-permission android:name="android.permission.READ_SMS" />
Without any filters:
import { readSMS } from 'react-native-get-sms-list';
// ...
const result = await readSMS();
Or with optionals filters:
const filters = {
type: 'inbox', // 'inbox' (default) | 'sent' | 'draft' | 'outbox' | 'failed' | 'queued',
id: '1', // specefic sms id,
address: 'Google', // sms address like a phone number,
orderBy: 'date ASC', // 'date asc' | 'date desc' | ...
minDate: '1729080977971', // string timestamp
maxDate: '1729080977971', // string timestamp
limit: 10, // return max 10 rows,
thread_id: '1', // return all sms on thread_id 1
};
const result = await readSMS(filters);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT