sms_sender 0.0.1
sms_sender: ^0.0.1 copied to clipboard
Flutter plugin to send SMS messages in the background and select a specific SIM card
sms_sender #
A Flutter plugin for sending SMS messages using a specified SIM card.
Features #
- Send SMS messages programmatically.
- Select a specific SIM card for sending SMS (Android only).
- Works on Android API 19+ (KitKat).
Permissions #
Android #
Add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS"/>
iOS #
Add the following key to your Info.plist:
<key>NSMessagingUsageDescription</key>
<string>This app requires permission to send SMS</string>
Installation #
Add this to your pubspec.yaml:
dependencies:
sms_sender: latest_version
Then run:
flutter pub get
Usage #
import 'package:sms_sender/sms_sender.dart';
void sendSMS() async {
final smsSender = SmsSender();
await smsSender.sendSms(
phoneNumber: "+628123456789",
message: "Hello, this is a test SMS!",
simSlot: 1, // Optional: specify SIM slot
);
}