dimanche 19 avril 2015

Method to attach local images to actions seems missing

Since using the standard SharePhoto doesn't allow you to add your own description, captions and other stuff. I am using OpenGraphStories share dialog. Now the problem is the facebook documentation says :


enter image description here


BUT!!! I cant find the addPhoto() anywhere. I have searched their references and even the pre 4.0 docs.


Code snippet:



ShareOpenGraphObject place = new ShareOpenGraphObject.Builder()
.putString("og:type", "place")
.putString("og:title", "sample title")
.putString("og:description", "sample description")
.putString("place:location:latitude", "Sample Location: Latitude")
.putString("place:location:longitude", "Sample Location: Longitude")
.build();

ShareOpenGraphAction publish = new ShareOpenGraphAction.Builder()
.setActionType("news.publishes")
.putObject("place", place)
.build();

SharePhoto photo = new SharePhoto.Builder()
.setBitmap(mCombinedBitmap)
.setUserGenerated(true)
.build();

ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("news")
.setAction(publish)
.build();

mShareDialog.show(ShareActivity.this, content);


-EDIT-


i found this putPhoto(String key, SharePhoto photo) which you can use in a ShareOpenGraphObject although I don't know the key yet. There is only the "og:image" but it's type only accepts URL.


Aucun commentaire:

Enregistrer un commentaire