2013-10-05 68 views
11

我試圖讓我的OpenGraph動作到新聞提要,並且我知道爲此我需要將ExplicitlyShared功能添加到Facebook應用程序的OpenGraph操作設置中,並且我做到了。然而,當我把它放在我的代碼中,像這樣:facebook 3.5sdk打開圖顯式共享

OpenGraphObject model = OpenGraphObject.Factory.createForPost("origame_app:model"); 
model.setProperty("title", modelname); 
model.setProperty("url", "http://samples.ogp.me/1386546688246429"); 
model.setProperty("description", modeldesc); 

Bitmap bitmap = decodeSampledBitmapFromUri(filepath[position], 500, 500); 
List<Bitmap> images = new ArrayList<Bitmap>(); 
images.add(bitmap); 

OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class); 
action.setProperty("model", model); 
action.setExplicitlyShared(true); 

@SuppressWarnings("deprecation") 
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "origame_app:fold", "model") 
    .setImageAttachmentsForObject("model", images, true) 
    .build(); 

uiHelper.trackPendingDialogCall(shareDialog.present()); 

我收到一個錯誤。但除此之外,OpenGraph的效果很好。有什麼問題?

+0

發佈您收到的錯誤 – sromku

+0

無法爲用戶生成預覽 – arvivlx2

+0

您是否解決了該問題?你可以與我分享如何使用action.setExplicitlyShared(true); – UserJava

回答