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]
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]