whatsapp utf char conflict fix
parent
a80eb5874f
commit
350b870cde
|
|
@ -140,7 +140,7 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
|||
);
|
||||
if (response.confirmed) {
|
||||
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);
|
||||
//FlutterOpenWhatsapp.sendSingleMessage(phoneNumber, "Спасибо что выбераете нас \r\n https://picsum.photos/200/300 ");
|
||||
|
|
@ -152,14 +152,15 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
|||
@required String message,
|
||||
}) async {
|
||||
String url() {
|
||||
return "whatsapp://send?phone=$phone&text=$message";
|
||||
// if (Platform.isIOS) {
|
||||
// return "whatsapp://wa.me/$phone/?text=$message";
|
||||
// } else {
|
||||
// return "whatsapp://send?phone=$phone&text=$message";
|
||||
// }
|
||||
//return "whatsapp://send?phone=$phone&text=$message";
|
||||
if (Platform.isIOS) {
|
||||
return "whatsapp://wa.me/$phone/?text=${Uri.encodeFull(message)}";
|
||||
} else {
|
||||
return "whatsapp://send?phone=$phone&text=${Uri.encodeFull(message)}";
|
||||
}
|
||||
}
|
||||
|
||||
print(url());
|
||||
if (await canLaunch(url())) {
|
||||
await launch(url());
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue