I need to add an SMS link / button or phone number saying TEXT US or TEXT 123-456-789 that when clicked that triggers a phone’s native messaging app with the recipient’s number auto-populated.
Must work on iOS and and Android
Freelance project
Budget $200
Email steve@startinggatemarketing.com
Can be done easely.
If you want, you can contact me here —> velo-ninja@outlook.com
Or you do it on your own…
Test it on your website…
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>SMS Link Example</title>
</head>
<body>
<button onclick="sendSMS()">Text Us</button>
<script>
function sendSMS() {
var phoneNumber = '123456789';
var message = 'Hello there!';
var smsLink = 'sms:' + phoneNumber + '?body=' + encodeURIComponent(message);
// Open the SMS link
window.location.href = smsLink;
}
</script>
</body>
</html>
A very simple example how it could work…
Thanks will test it and let you know if works on iPhone. I assume it can be styled as well?
I tested it and it does not work on iOS
-
You can use CSS-STYLES inside the HTML-Comp. yes!
-
Don’t have an iPhone, can’t test it.
What do you get on iPhone?
How do look like the result?
You will have to connect HTML-Comp. with your wix-website.
But i think there is also a DIRECT-CODED-WAY possible, without usage of the HTML-Component.
Nothing happens on iPhone. I had friend test it, that has been the issue. 2 Other coders could not get it to work on iPhone.
Well, this is why i am not an iPhone-fan
(nothing works on iPhone xD) .
ANDROID —> BEST !!!
- You have installed an SMS-APP on your iPhone?
- another code-approach for —> window.location.href
window.open(smsLink, '_blank');
- May be this one works, who knows…
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>SMS Link Example</title>
</head>
<body>
<button onclick="composeSMS()">Text Us</button>
<script>
function composeSMS() {
var phoneNumber = '123456789';
var message = 'Hello there!';
var smsLink = 'sms:' + phoneNumber + '&body=' + encodeURIComponent(message);
// Open the Messages app with the pre-populated message
window.location.href = smsLink;
}
</script>
</body>
</html>
- Alternatives: —> Twilio, SendGrid
https://www.wix.com/velo/example/twilio-integration
Hi Steve,
Just sent you a mail, kindly check it out! 