• Post Reply Bookmark Topic Watch Topic
  • New Topic

Android Sharing Photo and Text together using ShareOpenGraphObject

 
navin rajpandey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to post image and text together thorough my android app but the share dialog appears with post link disabled and even the window disappears itself after few seconds with error: Failed to generate preview for user.. something wrong in my code?

SharePhoto photo1 = new SharePhoto.Builder()
.setBitmap(bi)
.setImageUrl(Uri.parse(recUrl))
.build();

ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("og:type", "healthsynergy.photo")
.putString("og:title", "food")
.putString("og:description", "This is a wonderful food.")
.putPhoto("og:image",photo1)
.build();


ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType("healthsynergy.publish_actions")
.putObject("photo", object)
.build();
ShareOpenGraphContent content1 = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("photo")
.setAction(action)
.build();


shareDialog.show(content1);
XV429.png
[Thumbnail for XV429.png]
JHqli.png
[Thumbnail for JHqli.png]
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!