Update Whatsapp contacts programmatically

I make a function in iOS where I add a new contact to the user's address book programmatically and everything is going well. The next step is to send a message via Whatsapp to this new contact, which is also not very difficult. The goal is to directly display the chat screen with a new contact. However, the problem is that Whatsapp is syncing her contacts now and then. I use the following intent for Whatsapp:

var whatsappUrl = (NSURL(string:"whatsapp://send?text=\(encodedmessage)&abid=\(id)")) 

If the message is an encoded string and id is the identifier from a newly added contact. When my program opens Whatsapp with this method, everything will be fine when the contact was already in the address book. When this contact is added again, the Whatsapp screen will not go directly to this screen. Instead, it displays a collector for all contacts.

In short, I want to update Whatsapp contacts using my code to send the user directly to the Whatsapp chat screen of a new contact, and not to the contact selection screen, because Whatsapp contacts are not yet synchronized with the new contact.

+57
ios whatsapp
Jan 16 '15 at 13:21
source share
2 answers

It is recommended that you do not interact with other third-party applications, unless they provide a handle for interaction. Whats already given by whatsapp as an openurl scheme.

If you have a contact that has been deleted or added, you must first solve the problem in your application so that it does not trigger an action to open the application before checking the evening with wahtsapp.

You can use the large library that APAddressBook to add and modify contact verification.

+1
Jan 22 '16 at
source share

Obviously you cannot. Since the WhatsApp synchronization procedure is performed inside the application itself, you will not be able to synchronize outside the application. What you could try to do is add the full number with the country code to the URL, and then parse it on WhatsApp. WhatsApp needs to subscribe to the presence, and so you can send a message to this number.

0
Dec 30 '15 at 16:50
source share



All Articles