Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whatsapp message for a new number

Hi as far as I know whatsapp support abid and text parameters like 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 message to a new number. For example if my number is +123456

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

This doesn't work.

Because if the user insert the customer's whatsapp number, the App should popup the whatsapp message box with this number.

I noticed in some cases i can send message to number which is not listed in contact list. im wondering how it works.

like image 904
Zumry Mohamed Avatar asked Oct 18 '22 21:10

Zumry Mohamed


1 Answers

From WhatsApp docs :

abid : Address book ID of contact to start a chat with. If contact with this ID has only one whatsapp-able phone number, application will open a conversation with that contact. If contact with this ID has more than one whatsapp-able phone numbers, application will present a menu with all phone numbers available for chat. If contact has no whatsapp-able phone numbers, or contact with this ID does not exist, or this parameter is missing, application will present contact picker listing all contacts available for chat via WhatsApp.

As we read above , abid is not the phone number, rather is it the Address Book ID of the destination contact.

As you say, you have to use a new number, a contact picker will open up first and allow to select a contact from it.

like image 162
Sagar D Avatar answered Oct 21 '22 17:10

Sagar D