尝试发布Open Graph故事时,我收到以下错误。
Error{FacebookServiceException: httpResponseCode: -1, facebookErrorCode: 1611072, facebookErrorType: null, message: Action
Requires At Least One Reference: The action you're trying to publish
is invalid because it does not specify any reference objects. At least
one of the following properties must be specified: victory.
我没有在文档中找到有关此属性胜利的任何内容。
我用来发布故事的代码:
ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("og:type", "games")
.putString("og:title", "<Title>")
.putString("og:url","<website>")
.putString("og:image","<image link>")
.putString("og:description", "Teste")
.build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType("games.celebrate")
.putObject("games", object)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("games")
.setAction(action)
.build();
ShareDialog.show(thisActivity, content);
我怎样才能使它工作?
根据https://developers.facebook.com/docs/reference/opengraph/action-type/games.celebrate/,您已经编写了如下代码块。尝试相反,你使用,有一些变化,如"og:type", "games.victory"
和.putObject("games:victory", object)
。所以在代码中进行更改。
ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("og:type", "games.victory")
.putString("og:title", "QoF")
.putString("og:url","https://appsonfire33.wixsite.com/website")
.putString("og:image:url","https://static.wixstatic.com/media/792c0f_ee1843bfce26447ab34eead294163182~mv2.png/v1/fill/w_80,h_80,al_c,usm_0.66_1.00_0.01/792c0f_ee1843bfce26447ab34eead294163182~mv2.png")
.putString("og:description", "Teste")
.build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType("games.celebrate")
.putObject("games:victory", object)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("games:victory")
.setAction(action)
.build();
ShareDialog.show(thisActivity, content);
希望这个帮助。