Android Question Whatsapp Intent

Chandrashekhar

Member
Licensed User
Longtime User
Please Help.

Following code doesn't work with whatsapp.

I can pickup contact from whatsapp but after that is says "sharing failed. please try again"




Code:
B4X:
Sub button1_click
Dim u As Uri
u.Parse("file://" & File.Combine(File.DirDefaultExternal,"writeon.png"))
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("image/png")
i.SetComponent("com.whatsapp/.ContactPicker")
i.PutExtra("android.intent.extra.STREAM",u)
StartActivity(i)
End Sub
It works for plain tax like this

B4X:
Sub button1_click
Dim i AsIntent
i.Initialize(i.ACTION_SEND,"")
i.SetType("text/plain")
i.SetComponent("com.whatsapp/.ContactPicker")
i.PutExtra("android.intent.extra.TEXT","HELLO")
StartActivity(i)
End Sub

Please help..... Thanks in advance
 

bionicle

New Member
Licensed User
Longtime User
hi
did anybody find a solution to send a text message directly to a specific whatsapp contact, without using the contact picker.??
Thanks for help
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
if is there a porting of whatsapi library
A port can be written when an official SDK is released. Whatsapp does not provide any official SDK. so there are no ports possible for it.
 
Upvote 0
Top