Is it possible to open Whatsapp with a especific number, I don't want to send or share anything.
I just want to click on a button on my app and open Whatsapp ready to send a message or click on call
I am achieving this in B4A with
B4X:
Dim i As Intent
i.Initialize("android.intent.action.SENDTO", "smsto:" & numphone)
Dim jo As JavaObject = i
jo.RunMethod("setPackage", Array("com.whatsapp"))
StartActivity(i)
Hello, i did it in Android, but i could not find how to do it in iOS. Here is the code in B4A: Dim Intent1 As Intent Intent1.Initialize(Intent1.ACTION_VIEW, $"https://api.whatsapp.com/send?phone=55${number}&text=${""}"$) Intent1.SetComponent("android/com.android.internal.app.ResolverActivity")...
1) Read carefully my topic. First of all, you need to add #QueriesSchemes : whatsapp
2) If you want to start a chat, you need to specify a phone nomber.
this code works fine, thank you all
and yes !!!! you need #QueriesSchemes : whatsapp (thank you Semen Matusovskiy and mcqueccu)
and one last thing:
YOU MUST HAVE WHASAPP INSTALLED
B4X:
Sub OpenChatWithNumberW4b(numphone As String)
Dim temp As String = "whatsapp://send?phone=112312345678&text=hello"
Dim app As Application
'Dim su As StringUtils
'temp = su.EncodeUrl(temp,"UTF8")
Log(temp)
If app.CanOpenUrl(temp) Then app.OpenUrl(temp)
End Sub