2015-12-01 12 views
12

私のカスタムOpen GraphオブジェクトのカスタムプロパティをAndroidアプリケーションの共有ダイアログに表示できません。カスタムオブジェクトをネームスペースmyradio_androidに作成し、チャネルにカスタムプロパティcurrent_song_titleを定義しました。私もカスタムアクションを作成しました。を楽しんでいますが、私のカスタムプロパティcurrent_song_titleを共有ダイアログに表示できません。私が得たものは、以下の貼り付けられたイメージを見ることができます。ここで私のカスタムオープングラフオブジェクトのカスタムプロパティは共有ダイアログに表示されません

は、私は[共有]ダイアログを作成するために使用していたコードです:

// Facebook 
    mImageButtonShareOnFacebook = (ImageButton)view.findViewById(R.id.shareOnFacebook); 
    mImageButtonShareOnFacebook.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 

      FacebookSdk.sdkInitialize(getActivity().getApplicationContext()); 

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

      // Create an object 
      ShareOpenGraphObject object = new ShareOpenGraphObject.Builder() 
        .putString("og:type", "myradio_android:channel") 
        .putString("og:title", channel.getName()) 
        .putString("og:description", "My description") 
        .putString("myradio_android:channel:current_song_title", _title) 
        .putPhoto("og:image", photo) 
        .build(); 


      // Create an action 
      ShareOpenGraphAction action = new ShareOpenGraphAction.Builder() 
        .setActionType("myradio_android:enjoy") 
        .putObject("channel", object) 

        .build(); 

      // Create the content 
      ShareOpenGraphContent content = new ShareOpenGraphContent.Builder() 
        .setPreviewPropertyName("channel") 
        .setAction(action) 
        .build(); 

      ShareDialog.show(NowPlayingFragment.this, content); 

     } 
    }); 

enter image description here

編集:

enter image description here

+0

ストーリーを設定してカスタムオブジェクトのプロパティを表示しましたか? https://developers.facebook.com/docs/sharing/opengraph/custom#configure、Attachments-> Item Layoutを参照してください。キャプション行のいずれかでカスタムプロパティを使用するには、 '{'と打ち込みます。利用可能なすべてのプロパティのオートコンプリートリストが表示されます。 – CBroe

+0

ありがとうございましたが、私はすでにそれを行っています(添付のスクリーンショットを参照)。まだ表示されていません。 – burakk

+0

それは最終的なポストに現れますか? – CBroe

答えて

-1

代わりのmyradio_android:channel:current_song_title:私は編集添付ファイルダイアログを添付しています試してくださいmyradio_android:current_song_title

関連する問題