2017-12-19 8 views
0

オープン・グラフストーリーを投稿しようとすると、次のエラーが表示されます。Androidアプリでオープン・グラフ・エラーが発生しました:アクション少なくとも1つの参照が必要

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); 

は、どのように私はそれを動作させることができますか?

+0

facebook sharingに関する他のコードを教えてもらえますか? –

+0

上記のコードとこれは:https://stackoverflow.com/questions/47912271/faceboook-android-sdk-error-publish-actions-being-required-to-post-a-share-dial 私はすべてですか?今までやったことがあります。 – Siqueira

答えて

2

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); 

このヘルプが必要です。

+0

こんにちは、この投稿を投稿した後にfbページに投稿されますか? –

関連する問題