whatsapp utf char conflict fix

4.4
Serik Uvaissov 2020-07-04 22:16:16 +06:00
parent a80eb5874f
commit 350b870cde
1 changed files with 8 additions and 7 deletions

View File

@ -140,7 +140,7 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
); );
if (response.confirmed) { if (response.confirmed) {
String phoneNumber = response.responseText; String phoneNumber = response.responseText;
String msg = "Спасибо за покупку! \r\n https://picsum.photos/200/300 "; String msg = "Спасибо за покупку!\n https://picsum.photos/200/300 ";
launchWhatsApp(phone: phoneNumber, message: msg); launchWhatsApp(phone: phoneNumber, message: msg);
//FlutterOpenWhatsapp.sendSingleMessage(phoneNumber, "Спасибо что выбераете нас \r\n https://picsum.photos/200/300 "); //FlutterOpenWhatsapp.sendSingleMessage(phoneNumber, "Спасибо что выбераете нас \r\n https://picsum.photos/200/300 ");
@ -152,14 +152,15 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
@required String message, @required String message,
}) async { }) async {
String url() { String url() {
return "whatsapp://send?phone=$phone&text=$message"; //return "whatsapp://send?phone=$phone&text=$message";
// if (Platform.isIOS) { if (Platform.isIOS) {
// return "whatsapp://wa.me/$phone/?text=$message"; return "whatsapp://wa.me/$phone/?text=${Uri.encodeFull(message)}";
// } else { } else {
// return "whatsapp://send?phone=$phone&text=$message"; return "whatsapp://send?phone=$phone&text=${Uri.encodeFull(message)}";
// } }
} }
print(url());
if (await canLaunch(url())) { if (await canLaunch(url())) {
await launch(url()); await launch(url());
} else { } else {