android - Unable to share Image using Facebook SDK -
i able share on facebook using function below if remove ".setimageurl(imgtoshare)"
my package name correct when building imgtoshare , r.drawable.ic_launcher exists.
what issue here? want share image drawable folder.
public final void launchfacebook() { uri imgtoshare = uri.parse("android.resource://com.mypackage.name/" + r.drawable.ic_launcher); if (sharedialog.canshow(sharelinkcontent.class)) { sharelinkcontent linkcontent = new sharelinkcontent.builder() .setcontenttitle("focuson") .setcontentdescription( "text post facebook") .setcontenturl(uri.parse("http://developers.facebook.com/android")) .setcontenturl(uri.parse("https://www.myurl.com")) .setimageurl(resourcetouri(getapplicationcontext(), r.drawable.ic_launcher)) .setimageurl(imgtoshare) .build(); sharedialog.show(linkcontent); } }
looks sharing photos on facebook works little different sharing links. haven't tested following, after reading docs think should this:
sharephoto photo = new sharephoto.builder(). .setimageurl(imagetoshare) .setcaption("text post facebook") .build(); sharephotocontent content = new sharephotocontent.builder() .addphoto(photo) .build(); sharedialog.show(content); refs
Comments
Post a Comment