UNMAINTAINED
This project is unmaintained
Flutter SMS
This is an SMS library for flutter.
It only support Android for now (I can't do it for iOS because I don't own Mac).
Getting Started
For help getting started with Flutter, view our online documentation.
For help on editing plugin code, view the documentation.
Installation and Usage
Once you're familiar with Flutter you may install this package adding sms
(0.1.4 or higher) to the dependencies list
of the pubspec.yaml
file as follow:
dependencies:
flutter:
sdk: flutter
sms: ^0.2.0
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
Then run the command flutter packages get
on the console.
Querying SMS messages
Add the import statement for sms
and create an instance of the SmsQuery class:
import 'package:sms/sms.dart';
void main() {
SmsQuery query = new SmsQuery();
}
Getting all SMS messages
List<SmsMessage> messages = await query.getAllSms;
Note: the use of await
keyword means that getAllSms
is resolved asynchronously
and a Future is retorned.
Filtering SMS messages
The method querySms
from the SmsQuery
class returns a list of sms depending of the supplied parameters. For example,
for querying all the sms messages sent and received write the followed code:
await query.querySms({
kinds: [SmsQueryKind.Inbox, SmsQueryKind.Sent]
});
You can also query all the sms messages sent and received from a specific contact:
await query.querySms({
address: getContactAddress()
});
Getting all Threads Conversations
With SmsQuery
you can also get the entire list of conversations:
List<SmsThread> threads = await query.getAllThreads;
Roadmap
x
SMS Receiverx
SMS Senderx
SMS Deliveryx
SMS Queryx
SMS Threadx
Contactx
Contact Photo (full size, thumbnail)x
User profile (basic info)
Contributors
App logo
Designed and created by Imrul kayes
Contributions
Any contribution is welcome.