Issue
private void share(Uri uri){
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("audio/*");
waIntent.putExtra("jid", get_DATA.getSelectedPhonewdcountrycode() + "@s.whatsapp.net"); //phone number without "+" prefix
waIntent.setPackage("com.whatsapp");
waIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(waIntent, "Share with"));
}
I have tried many solution but every solutio takes me to whatsapp contact list to chose a contact, i want the file to be send directly to users inbox BTW it does take me to the targeted contact after a few second delay but it toast a message File is not supported
Solution
I solved it by asking user to select contact from list and then redirected to WhatsApp using intent (a short version now exist as https://api.whatsapp.com/send?phone=919773207706&text=Hello
,
Here is the a use full link relevant to it
) BUT the main problem with my app was the File is not supported which was a security issue that was solved using MediScanner along with file provider configurations
Answered By - TPX
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.