Last updated:
0 purchases
flutter sim data
flutter_sim_data #
This Flutter plugin provides API to
Android: Fetch SIM data to send SMS with dual sim and eSIM support.
iOS: Send SMS using MFMessageComposeViewController for iOS
SDK Compatibility #
Dart '>=3.4.4 <4.0.0'
Flutter '>=3.3.0'
Android >=22
iOS >=12.0
Android compileSDK 34
Android #
The plugin adds the READ_PHONE_NUMBERS and READ_PHONE_STATE permissions and checks and requests those permissions.
Since sending SMS is not what every app might need, the SEND_SMS permission is not added to the manifest file by the plugin.
Make sure to add the SEND_SMS permission to the manifest file if the app need to send SMS.
The plugin notifies when the SMS is sent and delivered respectively via toast messages.
import 'package:sim_data/sim_data.dart';
import 'package:sim_data/sim_data_model.dart';
final _simData = SimData();
final List<SimDataModel> simData = await _simData.getSimData()
_simDataPlugin.sendSMS(
phoneNumber: "+11234567890",
message: "test message",
subId: simData.first.subscriptionId
);
copied to clipboard
iOS #
Since iOS does not support sending a SMS in the background without user interaction, the plugin uses MFMessageComposeViewController to lets the user compose and send SMS.
The sendSMS method can be called directly and since subId parameter is not used for iOS, it can be any int.
import 'package:sim_data/sim_data.dart';
_simDataPlugin.sendSMS(
phoneNumber: "+11234567890",
message: "test message",
subId: 0
);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.