共享对话框中未显示我的自定义打开图形对象的自定义属性

时间:2015-12-01 12:32:24

标签: android facebook facebook-graph-api facebook-opengraph

我无法在Android应用的“分享”对话框中显示自定义Open Graph对象的自定义属性。我在命名空间 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

1 个答案:

答案 0 :(得分:-1)

而不是myradio_android:channel:current_song_title尝试myradio_android:current_song_title

相关问题