I'm trying to share a custom opengraph story. Here is my code:
ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("og:type", "music.song")
.putString("og:title", item.title)
.putString("og:description", item.title)
.build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType("jukeboxandr:play")
.putObject("song", object)
//.putString("place", venue.fbplaceid)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("song")
.setAction(action)
.setPlaceId(venue.fbplaceid)
.build();
ShareDialog.show(PlaylistActivity.this, content);
I see everything fine, for me, everything works perfectly. However for my client it doesn't, he gets exception 'Failed to generate preview for user'. I think that is because I'm administrator of facebook app and he isn't. So my question is, does OpenGraph sharing work only for approved facebook apps? My facebook app is set to public, but not sent to the review team
Indeed you need to submit for review, see this doc.
Story Submission Process
The Graph API allows third-party apps to integrate deeply with Facebook. Your app can use the Graph API to share rich, structured stories on Facebook. These stories can increase your app's engagement, distribution, and growth.
We review your app's stories to ensure a consistent, high-quality experience on Facebook. Three important notes:
- All platforms listed in your App Settings go through review. Please do not list platforms without Facebook integration (i.e. websites without Facebook Login).
- Using a Social Plugin, such as the Like button, does not require review.
- For mobile apps, app domains are no longer needed to track installs or create stories. This document outlines our guidelines and submission criteria. This document may evolve as we continue to learn how people interact with the Graph API.
However, if you would like your client to "test" this, you could simply add them to your app from the Roles tab.