如何在Flutter WhatsApp Launcher+URL中发送消息

jucafojl  于 11个月前  发布在  Flutter
关注(0)|答案(1)|浏览(126)
var phoneNumber = "917390123456";
var urlString = "whatsapp://send?phone=$phoneNumber";

// Convert the String URL to a Uri object
final Uri url = Uri.parse(urlString);

if (await canLaunchUrl(url)) {
    await launchUrl(url);
}

字符串
如何使用IOS的Launcher_url
我得到的错误:
PlatformException(PlatformException(channel-error,Unable to establish connection on channel.,null,null))

pbwdgjma

pbwdgjma1#

如果您想使用外部链接,请将这些行添加到/ios/Runner/Info.plist文件中。

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>sms</string>
  <string>tel</string>
</array>

字符串
您也可以使用此链接:https://wa.me/$phonenumber

launchUrl(Uri.parse("https://wa.me/91xxxxxxxx?text=Hello"),
   mode: LaunchMode.externalApplication,);

相关问题