sendSmsByDefaultApp method

Future<void> sendSmsByDefaultApp({
  1. required String to,
  2. required String message,
})

Open Android's default SMS application with the provided message and address.

Requires SEND_SMS permission.

Parameters:

  • to : Address to send the SMS to.
  • message : Message to be sent.

Implementation

Future<void> sendSmsByDefaultApp({
  required String to,
  required String message,
}) async {
  final Map<String, dynamic> args = {
    "address": to,
    "message_body": message,
  };
  await _foregroundChannel.invokeMethod(SEND_SMS_INTENT, args);
}