Sending Whatsapp Message to a Specific Contact Number (Swift Project)

Sending Whatsapp message to a specific contact number (Swift Project)

Two issues.

The first is that's not a valid url scheme. A URL scheme takes the format identifier://params so you'll need to use whatsapp://phone_number instead.

Secondly is that Apple now requires you to define which external url schemes that your application uses in your Info.plist file, nested under the key LSApplicationQueriesSchemes. Please see iOS 9 not opening Instagram app with URL SCHEME for more info.


According to the Whatsapp URL scheme docs, you can't actually supply the phone number of the contact that you'd like to send the message to: https://www.whatsapp.com/faq/en/iphone/23559013.

You can however supply the message that you'd like to send to them:

whatsapp://send?text=Some%20Text.

Ensure that the text is percentage encoded as otherwise NSURL will fail to create a valid URL from the supplied string.

How to send message to contact in Whatsapp from iOS App - Swift

For security purpose Apple doesn't allow you to send to a particular contact.

Open Whatsapp on a particular number in swift

As per this whatsapp forum link, there is no way you can send message to specific user, this is not available within whatsapp URL scheme.

You just set predefined message and then with URL scheme you are able to open whatsapp recent controller.

Send text to specific contact programmatically (whatsapp)

This is now possible through the WhatsApp Business API. Only businesses may apply to use it. This is the only way to directly send messages to phone numbers, without any human interaction.

Sending normal messages is free. It looks like you need to host a MySQL database and the WhatsApp Business Client on your server.

Whatsapp URL Schema send message to phonenumber

No, it's not possible to send someone a message using WhatsApp without storing the number in Contact Book. And the reason for that is exactly what you're trying to do: WhatsApp won't allow you to send random numbers 'spam'. You'll have to collect numbers and add them to your contacts and then send them a message manually.



Related Topics



Leave a reply



Submit