Blackberry webworks 如何访问BB10中的FB共享?
我曾尝试在facebook上分享,但无法分享任何东西。 我使用的代码是:- 在Javascript中Blackberry webworks 如何访问BB10中的FB共享?,blackberry-webworks,Blackberry Webworks,我曾尝试在facebook上分享,但无法分享任何东西。 我使用的代码是:- 在Javascript中 FB.init({ appId: 'some id', cookie: true, status:true, xfbml:true, oauth:true }); function postToFeed() { // calling
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" />
提前感谢。如果你只想在Facebook上分享你的应用程序中的内容,你可以很容易地用卡片来实现 我在这里写了一篇博文: 基本上,您使用BlackBerry调用框架来调用该卡,并将一些数据传递给该卡
function invokeFacebook() {
blackberry.invoke.invoke({
target: "Facebook",
action: "bb.action.SHARE",
type: "text/plain",
data: "I’m eating tacos with Alex."
}, onSuccess, onError);
}
如果要共享图像,只需将“数据”属性替换为:
uri: 'file://' + pathToFile,
我们的GitHub repo上还有一个示例应用程序:嗨,chadtatro,我收到一个错误“调用错误:调用\u无\u目标\u错误”你能帮我吗?谢谢