share image does not work in viber and facebook
Asked Answered
D

1

18

I use the code below for sharing images but unfortunately it works only for Line, not for Facebook and Viber

Code:

 Intent share = new Intent(android.content.Intent.ACTION_SEND);
 share.setType("image/png");
 share.putExtra(Intent.EXTRA_STREAM, Uri.parse(G.DIR_APP + "/sample_image.png"));
 startActivity(Intent.createChooser(share, "Share image"));
Dermatitis answered 25/5, 2014 at 13:48 Comment(5)
and how is that suppose to work for facebookHoffmann
can you let me know what is complete path here of the bitmap ?Fulfil
facebook app open but image doesn't displayDermatitis
Isn't this a duplicate of this?Colza
Anyway, some guy pointed this out here: "Facebook IGNORES our text. They say "These fields are intended for users to express themselves. Pre-filling these fields erodes the authenticity of the user voice." One workaround is to use the Facebook SDK to post, but that doesn't allow the user to choose how they want to share. We can also make a custom landing page, and the link will show the <meta content ="..."> text from that page with our link in Facebook."Colza
A
2

Share directly to Facebook and Viber...

Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/png");
share.setPackage("com.facebook.katana"); 
//for viber package is "com.viber.voip".
share.putExtra(Intent.EXTRA_STREAM, ImageUri);
startActivity(p_intent.createChooser(share, "Share With"));
Aspergillum answered 29/5, 2014 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.