共享对话框中未显示“我的自定义打开图形对象”的自定义属性
我无法获取我的Android应用程序的共享对话框中显示的自定义Open Graph对象的自定义属性。我在命名空间 myradio_android 中创建了一个自定义对象通道,并在通道中定义了一个自定义属性 current_song_title 。我还创建了一个自定义操作享受,但是我无法获得共享对话框中显示的我的自定义属性current_song_title。
I cannot get the custom properties of my custom Open Graph object displayed in the Share dialog of my Android app. I created a custom object channel in the namespace myradio_android, and defined a custom property current_song_title in channel. I also created a custom action enjoy, but I cannot get the my custom property current_song_title displayed in the Share dialog. What I get can be seen the pasted image below.
以下是我用于创建共享对话框的代码:
Here's the code I am using to create the Share dialog:
// 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);
}
});
编辑:我附加了编辑附件对话框:
I have attached the Edit Attachments dialog:
而不是 myradio_android:channel:current_song_title
try myradio_android:current_song_title