How to send the same WhatsApp message to 3 or 4 different contacts registered in a SQLite archive?
The following code sends only one message and forgets the others.
[CODE lang="b4x" ]
TxtWA="Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod"
rs=db.ExecQuery ("SELECT * FROM ....")
For i=0 To rs.RowCount-1
rs.Position=i
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, "https://api.whatsapp.com/send?phone=" & rs.GetString("Telefono") & "&text=" & TxtWA )
Intent1.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(Intent1)
Next
rs.close[/CODE]
It's not possible. You can only send one message to one contact per api call. You have to wait until the user is back in the app to send the next message to whatsapp
It is a pity.
According to what you say it should be possible:
1) set the parameters for the first call
2) enter WhatsApp
3) press the WhatApp send button
4) exit WhatsApp (important)
5) set the parameters for the second call
6) enter into WhatsApp again
7) press the WhatApp send button
8) etc. etc.
I would also be willing to adopt such a solution, however cumbersome.
In fact, I'm surprised that the code I posted doesn't already do what I described.
🟢 Get an Alternative and Budget-Friendly Access to WhatsApp API 💡 🚀 GREEN-API Service — seamless WhatsApp integration with any programming language: PHP, JavaScript, 1C, Python, Java, C#, VBA.
green-api.com
You can take a look at that API, use WhatsApp Web to send messages and other things.
Green API is a platform that allows you to send and receive WhatsApp messages through a stable API. 1. It is possible to send and receive text, photos and videos without the need to purchase and monitor a phone 2. Stable WhatsApp API works without a phone and your number is safe when using...
www.b4x.com
You can use my library, as for the demo project I am updating it
I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact.
As a further difficulty I add that my app does not use B4X Pages.
Could you check if it is really possible to achieve what you want using the library in question ?
I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact.
As a further difficulty I add that my app does not use B4X Pages.
Could you check if it is really possible to achieve what you want using the library in question ?
Thank you.
Something very very simple.
A text ("Lorem ipsum etc. etc")
Two phone numbers
One button
Maximum delay in shipping 1 or 2 minutes
No B4X Pages
Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register their WhatsApp number. And this would be too complicated for users of my app.
In any case I tried your code and the result is negative.
This is the log
My app is "SONO QUI" but I don't know if it is available outside of Italy.
You simply have to send a certain text to 3 or 4 (no more) WhatsApp contacts within a few minutes.
Thanks for your patience
Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register