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

ilan

Expert
Licensed User
Longtime User
thanks guys now the question is this.

what will happen if one user is on ios and send the url to user that is on android?
is it possible to create a universal url that will work on both platform?

EDIT: so i will explain what i mean.
the link should be shared using whatsapp and clicking on it should open the app and read the string that is shared with the url (like a id).
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
thanks guys now the question is this.

what will happen if one user is on ios and send the url to user that is on android?
is it possible to create a universal url that will work on both platform?

EDIT: so i will explain what i mean.
the link should be shared using whatsapp and clicking on it should open the app and read the string that is shared with the url (like a id).
I assume you accidentally replied to this old thread.
 
Upvote 0
Top