在Android上,
sms:支持完整的URI,您可以发送带有这样的正文(RFC5724)的消息:
_textMe() async { // Android const uri = 'sms:+39 348 060 888?body=hello%20there'; if (await canLaunch(uri)) { await launch(uri); } else { // iOS const uri = 'sms:0039-222-060-888'; if (await canLaunch(uri)) { await launch(uri); } else { throw 'Could not launch $uri'; } } }在iOS上,您只能使用The的数字字段
URI。
sms方案用于启动Messages应用程序。此类型的URL的格式为“
sms:”,其中是一个可选参数,用于指定SMS消息的目标电话号码。此参数可以包含数字0到9以及加号(+),连字符(-)和句点(。)。
URL字符串不得包含任何消息文本或其他信息 。
PS。要检查平台,可以使用dart.io库
Platform类:
if (Platform.isAndroid) {} else if (Platform.isIOS) {}


