sendSMS method
Future<void>
sendSMS({
- required String phone,
- required String message,
- SmsCompletion completeOn = SmsCompletion.sent,
- Duration timeout = const Duration(seconds: 30),
override
Sends message to phone, completing when completeOn is satisfied or
failing after timeout.
Implementation
@override
Future<void> sendSMS({
required String phone,
required String message,
SmsCompletion completeOn = SmsCompletion.sent,
Duration timeout = const Duration(seconds: 30),
}) async {
try {
await methodChannel.invokeMethod<void>('sendSMS', {
'phone': phone,
'message': message,
'completeOn': completeOn.value,
'timeoutMillis': timeout.inMilliseconds,
});
} on PlatformException catch (e) {
throw _asTelephonySmsException(e);
} on MissingPluginException {
throw _unsupportedPlatform();
}
}