我试着在facebook上分享,但不能分享任何东西。我使用的代码是:
在Javascript中
FB.init({
appId: 'some id',
cookie: true,
status:true,
xfbml:true,
oauth:true
});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
link: 'http://www.example.com',
picture: imageToShare,
name: 'name',
caption: 'This Link is Shared through the some application.',
description: ''
};
function callback(response) {
//document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}在配置文件中
<access uri="http://connect.facebook.net" />提前谢谢。
发布于 2013-02-26 03:35:24
如果你想从你的应用程序中分享一些东西到Facebook上,你可以使用Cards很容易地做到这一点。
我在这里写了一篇博文:http://devblog.blackberry.com/2013/02/twitter-and-facebook-cards/
基本上,您使用BlackBerry调用框架来调用卡片,并将一些数据传递给该卡片。
function invokeFacebook() {
blackberry.invoke.invoke({
target: "Facebook",
action: "bb.action.SHARE",
type: "text/plain",
data: "I’m eating tacos with Alex."
}, onSuccess, onError);
}如果你想分享一张图片,你只需要把'data‘属性换成:
uri: 'file://' + pathToFile,在我们的GitHub存储库上还有一个示例应用程序:https://github.com/ctetreault/BB10-WebWorks-Samples/tree/master/invoke/invoker
https://stackoverflow.com/questions/14952142
复制相似问题