2

I have very little reputation points so I cannod add a comment in this similar question.

But I need an explanation as the code is working in a different way as expected.

I would like to have a link on my website where the user can click on the whatsapp link and start the conversation with the contact.

The code I add is this:

href="intent://send/0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end

where 0123456789 were substituted with a real number subscribed to whatsapp. But it seems working only with my contact. If I have a new number it will not work and will tell me that the contact number is not connected to whatsapp (even if it is).

  1. How can I solve this problem?
  2. Once this first problem is solved, I'd like to add some preformatted text to the message like: message sent from website xyz. What code should I add?
  3. This like of code is working for Android, I need it also for iPhone, what should I use?

This other code is working on Android and on iPhone, but it doesn't allow me to add a custom contact number:

<a href="whatsapp://send?abid=username&text=Hello%2C%20World!">whatsapp</a>

abid can be only an ID from a contact already saved in you phone, otherwise it will open the contact selection page in whatsapp

Please, don't share links without explanation of the content as I'm not a developer, I'm just trying to do my best following instructions of people with more knowledge.

Thank you.

Community
  • 1
  • 1
overkill22
  • 165
  • 1
  • 11

1 Answers1

1

As long as your explanation describes you are looking for a user to be able to Click in order to open a Chat with a specific Whatsapp active user.

Nowadays Whatsapp has emitted an API to specifically solve this needs, it's called 'Click to Chat' API and must work on all devices:

https://faq.whatsapp.com/en/general/26000030

Also, the scheme for the link you were using seems to be working correctly nowadays when used like this:

whatsapp://send?text=MESSAGE&phone=+NUMBER&abid=+NUMBER
DavidTaubmann
  • 3,223
  • 2
  • 34
  • 43