Android Question [solved]Open Whatsapp with a especific number

nedium

Active Member
Licensed User
Longtime User
Hi

Could you share an example of a complete project because it gives me an error with

#QueriesSchemes : whatsapp (Unsupported attribute: queriesschemes)

and with

Dim app As Application
(Undeclared variable 'app' is used before any value has been assigned to it.)


I wanted to know if I should add any other configuration


in reference
 

aeric

Expert
Licensed User
Longtime User
As what I have guessed. The code you posted above is for B4i.
In B4A, you can use Intent.

B4X:
Sub SendToWhatsapp(TextToSend As String)
    Dim Intent1 As Intent
    Intent1.Initialize(Intent1.ACTION_SEND ,"")
    Intent1.SetType("text/plain")
    Intent1.SetComponent("com.whatsapp/.ContactPicker")
    Intent1.PutExtra("android.intent.extra.TEXT", TextToSend )
    StartActivity(Intent1)
End Sub

or check this thread:

other threads:
https://www.b4x.com/android/forum/threads/whatsapp-intent.45414/#content
https://www.b4x.com/android/forum/threads/whatsapp-send-function.122650/#content
 
Last edited:
Upvote 1
Top