我正在处理一个Angular应用程序,假设出于论证目的,我没有使用任何元标签,如何使用Share Dialog让用户分享我的应用程序的页面?使用旧的Feed Dialog虽然可以,但已经被弃用了。
有什么提示吗?
$scope.share = function() {
FB.ui({
method: 'feed',
name: 'This is the name field',
link: 'The link',
picture: 'The picture',
caption: 'The caption',
description: 'This is the content of the "description" field, below the caption.'
})
},
function(response) {
if (response && !response.error_code) {
console.log('Posting completed.');
} else {
console.log('Error while posting.');
}
});
};
所以尽管这个方法可行,但我希望以同样的方式使用共享对话框,但我还没有想出来。以下是我一直在尝试的方法,请记住我是新手:
$scope.share = function() {
FB.ui({
method: 'share_open_graph',
action_type: 'og.likes',
action_properties: JSON.stringify({
object: {
'title': 'The title',
'image': 'An image',
'url': $scope.shareUrl,
'description': 'This is the description',
}
})
},
function(response) {
if (response && !response.error_code) {
console.log('Posting completed.');
} else {
console.log('Error while posting.');
}
});
};
有什么提示吗?