Add Whatsapp function to website, like sms, tel - javascript

I have a website that a lot of people view on mobile.
I have link for : Call and SMS and I want to add one for Whatsapp, so a user can click the whatsapp link I create and start a conversation with me.
If this is possible can someone point me in the right direction on how?

below link will open the whatsapp. Here "0123456789" is the contact of the person you want to communicate with.
href="intent://send/0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">

Check this link out
Launching Your iPhone App Via Custom URL Scheme
and more on the whats up url scheme document
I did a quick mock up and tried it on my iphone with a link like this from a webpage and it opened the app on my iphone.
whatsapp
I could not try to send a message as I don't have a current Whatsapp account sorry.
Add user name using abid parameter
let's say your whatsapp username was username then it would be
whatsapp
once again sorry I can't test this. Also I have no idea what would happen if the username is the actual user of the current mobile device. eg. You try to whatsapp yourself.

Here is the solution to your problem! You just need to use this format:
In the place of "urlencodedtext" you need to keep the content in Url-encode format.
UPDATE-- Use this from now(Nov-2018)
Use: https://wa.me/15551234567
Don't use: https://wa.me/+001-(555)1234567
To create your own link with a pre-filled message that will
automatically appear in the text field of a chat, use
https://wa.me/whatsappphonenumber/?text=urlencodedtext where
whatsappphonenumber is a full phone number in international format and
URL-encodedtext is the URL-encoded pre-filled message.
Example:https://wa.me/15551234567?text=I'm%20interested%20in%20your%20car%20for%20sale
To create a link with just a pre-filled message, use
https://wa.me/?text=urlencodedtext
Example:https://wa.me/?text=I'm%20inquiring%20about%20the%20apartment%20listing
After clicking on the link, you will be shown a list of contacts you
can send your message to.
For more information, see https://www.whatsapp.com/faq/en/general/26000030

This is possible by creating the following link:
whatsapp://send?text=Hello this has been opened from the browser&phone=+PHONENUMBER&abid=+PHONENUMBER
Thanks to:
https://forum.ionicframework.com/t/open-whatsapp-intent-with-msg-specific-contact/73903/4
I have tested this on iOS, Windows Phone and Android

I just posted an answer on a thread similiar to this here https://stackoverflow.com/a/43357241/3958617
The approach with:
whatsapp
and with
whatsapp
Only works if the person who clicked on your link have your number on their contact list.
Since not everybody will have it, the other solution is to use Whatsapp API like this:
Send Message
More details on this API here: https://www.whatsapp.com/faq/en/general/26000030
And observations on how to use it here: https://stackoverflow.com/a/43357241/3958617

Use:
https://wa.me/YOURNUMBER
where YOURNUMBER is without the two leading 00.
For instance for +37061204312 you write:
https://wa.me/37061204312
This link seems to work on mobiles and on desktop computers.
To prefill the message with text you can use:
https://wa.me/YOURNUMBER/?text=urlencodedtext
More in the Whatsapp FAQ: https://faq.whatsapp.com/en/android/26000030/

Rahul's answer gives me an error: You seem to be trying to send a WhatsApp message to a phone number that is not registered with WhatsApp..., even though I'm sending it to a registered WhatsApp number.
This, however works:
<li><a href="intent:0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end"><i class="fa fa-whatsapp"></i>+237 655 421 621</li>

Related

Redirection to microsoft teams app from browser

I'm working on angular project and I have a teams icon in .html. I need to redirect from browser to the teams app when the icon is clicked. Similar functionality is implemented for mail and phone number. When a user clicks on phone icon or mail icon, I'm doing this:
window.location.href = 'tel: 456****';
windo.location.href = 'mailto: example#gmail.com'
Tried for a while to know what should be assigned to window.location.href so that the redirection happens to teams app and didn't find any way for it. How do I redirect to teams using window location?
Take a look at the official documentation here:
https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-an-audio-or-audio-video-call
There's examples for both if you have an email address and if you have a phone number. (You'll need that 4: part before the phone number.)
https://teams.microsoft.com/l/call/0/0?users={emailaddress}
https://teams.microsoft.com/l/call/0/0?users=4:{phonenumber}

How to send message from Website To Telegram direct 1 number target?

i add the form message (html standart) and button(submit) from website to telegram APP, direct number precise: +00 123 456 789 (this is example number TARGET A).
this is for mobile (iOS,android) who has installed telegram app.
If users (any people) have not it the number contact "TARGET A" then add new contact..
If users (any people) have it the number contact "TARGET A" then send it direct in telegram app mobile..
If users (any people) have not the telegram app then re-direct other page: www.company.com/miss-telegram.html
i will write the message : sorry, you have not the app Telegram, if want to add the app telegram then click, go to link: https://play.google.com/store/apps/details?id=org.telegram.messenger for andorid or https://itunes.apple.com/it/app/telegram-messenger/id686449807 for Ios..
can you help me how build it?
note: i'm base html build and not expert.. i'm newbie..
note: i dont know what is best code language: javascript, html5,php,..
you can try different code for javascript, for html5, for php..to see what is best solution (easy)..
thank you
so i dont know how builds it from html standart for send to telegram direct target number..

Sending message on Intercom on user's behalf

does anyone know how to send a message from intercom(https://www.intercom.com/) on user's behalf? I need to set up an event listener that opens intercom chat window and sends a message when a some button is clicked.
i am working with react version of intercom if it helps.
will be very grateful for any hints.
If you are using the Intercom chat widget, you can pre-populate a custom message in the widget on the user's behalf like so
const myCustomMessage = 'Hi there!'
window.Intercom('showNewMessage', myCustomMessage)
Of course, the user still has to actually send the message. This might not be exactly what you wanted but it's an alternative in case you want to fully automate everything except the decision to send the message (which is the right UX in a lot of situations).
Documentation is here.
for those who are in the same trouble:
https://developers.intercom.com/reference#user-or-contact-initiated-conversation
For sending messages on the user's behalf, you may check this out https://developers.intercom.com/intercom-api-reference/reference/create-a-conversation
You may need the user's user_id or id from the reference above to create a conversation. For those who are using MobileSDK or intercom_flutter, the id is not provided within the package or SDK. I found a workaround by using this Search for contacts API to get the id.

Plaxo Contact Widget message

I used plaxo contact widget to pull gmail, yahoo mail contacts and many. It's working fine, but every time when I open that page it will show a popup window with the following error message:
unable to add recipients . Please close the address book window and try again
Please suggest me what to do?
Unfortunately, we've retired our API Contact Widget and no longer support it as of October 31st 2011.. You can read more on our blog - http://blog.plaxo.com/2011/08/plaxo-widget-retirement/.
Thanks
p.s. You can try out cloudsponge.com :) (and you get a free trial if you mention Plaxo)

Facebook Request Dialog for single person

I am making a simple turn based board game on facebook. I plan to make a multiplayer mode where two player can play together like a duel mode. To do that, a person can send an app request to another person using facebook request dialog. But the user can select more that one person in that dialog. How do I make it send the request to only one person?
I could send to only one person using the graph API. But then, I need to get the target person's facebook id. I couldnt just 'prompt("Give me the user's facebook id")' for it. What the user need is a dialog where the user can select one of his friends, and return the facebook id. Is there such dialog in facebook? Or I will just need to make one.
You need to make one yourself.
Retrieve all friends through Graph API or FQL
Let the user choose one of them
Fire the Request Dialog with that specific friend's ID
i had the same question and landed here. I know that this is a old question but still people can and will find this.
So the right answer for me is:
FB.ui({method: 'apprequests',
message: 'My Great Request',
max_recipients : 1
}, requestCallback);
You can find this information at https://developers.facebook.com/docs/reference/dialogs/requests/
I hope I could help some developers
cheers.

Categories