iOS Question Send a message via WhatsApp

toro1950

Active Member
Licensed User
Hello, I need to send a message with whatsapp to a specific phone number, with the following code I can send a message but I have to choose
the recipient from the contact list and if they are different as in my case it is quite annoying.
B4X:
Dim testo As String
    testo= "Hello,......................."
    Dim avc As ActivityViewController
    avc.Initialize("avc", Array(testo))
    avc.Show(B4XPages.GetNativeParent(Me), Root) 
    Wait For avc_Complete (Success As Boolean, ActivityType As String)
With BA4 with the following code you can send a message to a specific number
B4X:
Dim testo As String
    testo= "Hello,..................."" 
    Dim Intent1 As Intent
    Intent1.Initialize(Intent1.ACTION_VIEW, $"https://api.whatsapp.com/send?phone=${phone number}&text=${testo}"$)
    StartActivity(Intent1)
Is there any possibility to do the same thing with B4i? maybe through a library or something
Thanks in advance to anyone who can help me
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
How about this?

 
Upvote 0
Top