Whatsapp message for new number

Hi, as far as I know whatsapp supports abid and text parameters, as shown below:

 NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"]; if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) { [[UIApplication sharedApplication] openURL: whatsappURL]; } 

But I want to send a message to the new number. For example, if my number is +123456

 NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?abid=+123456"]; 

This does not work.

Because, if the user inserts the whatsapp client whatsapp , the application should pop up in the whatsapp message whatsapp with this number.

I noticed that in some cases I can send a message to a number that is not listed in the contact list. they are interested in how it works.

+5
source share
1 answer

From WhatsApp docs :

abid: Contact address book identifier to start a chat. If a contact with this identifier has only one phone number available for use, the application will open a conversation with this contact. If the contact with this identifier has more than one phone number available for use, the application will present a menu with all the phone numbers available for chat. If the contact does not have phone numbers available for use, or the contact with this identifier does not exist or this parameter is absent, the application will display a list of contacts available for chat via WhatsApp.

As we read above, abid is not a phone number; rather, it is the address book identifier of the destination addressee.

As you say, you need to use the new number, first the contact selection panel opens and allows you to select a contact from it.

+3
source

Source: https://habr.com/ru/post/1237164/


All Articles