android_sms_reader 0.0.6 copy "android_sms_reader: ^0.0.6" to clipboard
android_sms_reader: ^0.0.6 copied to clipboard

PlatformAndroid

A Flutter plugin to read SMS messages on Android with filtering, search, and streaming support.

Flutter Android SMS Reader #

Pub Version Pub Likes Pub Points Popularity

A Flutter plugin to read SMS messages on Android. Supports inbox, sent, and draft messages with pagination, search, streaming of incoming messages, and permission handling.

⚠️ This plugin is Android-only. iOS does not allow SMS access due to platform restrictions.


πŸš€ Features #

Feature Description
βœ… Fetch All Messages Access all SMS on the device
βœ… Filter by Type Fetch only inbox, sent, or draft messages
βœ… Pagination Support Lazy loading of messages
βœ… Search SMS Filter by keyword or phone number
βœ… Message Count Total number of messages per type
βœ… Observe New SMS Stream new incoming messages in real-time
βœ… Read Permissions Auto-handle permission requests
βœ… Dual SIM Support (WIP) Read SIM info (planned)
βœ… Export to JSON Easily convert messages for sharing/storage

πŸ›  Installation #

Add this to your pubspec.yaml:

dependencies:
  android_sms_reader: ^<Latest-Version>

Then run:

flutter pub get

πŸ“² Usage #

import 'package:android_sms_reader/android_sms_reader.dart';

void init() async {
  bool granted = await SmsReader.requestPermissions();
  if (!granted) {
    // handle permission
    return;
  }

  final messages = await SmsReader.fetchMessages(
    type: SmsType.inbox,
    start: 0,
    count: 50,
    query: 'OTP',
  );

  final count = await SmsReader.getMessageCount(SmsType.sent);

  SmsReader.observeIncomingMessages().listen((sms) {
    print("Received: ${sms.body}");
  });
}

❗ Android Permissions #

Ensure you add these to your AndroidManifest.xml:


<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />

❌ iOS Support #

iOS does not support reading SMS messages. This plugin returns UnsupportedError on iOS platforms.

18
likes
160
points
45
downloads

Publisher

verified publisherstackobea.com

Weekly Downloads

A Flutter plugin to read SMS messages on Android with filtering, search, and streaming support.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on android_sms_reader

Packages that implement android_sms_reader