Facebook共享功能不工作
当我单击“共享”按钮时,警报(“输入”)显示其对“其他”部分的访问权限,但之后显示“在Facebook上共享此日记时出错”。Facebook连接工作正常。请帮助我解决此问题。提前感谢Facebook共享功能不工作,facebook,cordova,phonegap-plugins,ionic,Facebook,Cordova,Phonegap Plugins,Ionic,当我单击“共享”按钮时,警报(“输入”)显示其对“其他”部分的访问权限,但之后显示“在Facebook上共享此日记时出错”。Facebook连接工作正常。请帮助我解决此问题。提前感谢 $scope.share = function(detail){ alert("share"); if(!FbShare.getFbDataShare()) { ngFB.init({appId: '******
$scope.share = function(detail){
alert("share");
if(!FbShare.getFbDataShare())
{
ngFB.init({appId: '****************'});
ngFB.login({
scope: 'email'
}).then(function(response){
if(response.status === 'connected'){
FbShare.setFbDataShare(response.authResponse.accessToken);
$scope.share(detail);
}else{
$cordovaToast.showLongCenter("Facebook login failed");
}
});
}else{
alert("enter");
alert(detail.title);
ngFB.api({
method: 'POST',
path: '/me/feed',
params: {
message: "From My Diary",
name: detail.title,
description: detail.description
}
}).then(function(){
alert("The diary was shared on Facebook");
}, function(){
alert("An error occurred while sharing this diary on Facebook");
});
}
}
将实际的API响应记录到console中,看看它说了些什么。实际上我找到了,谢谢……代码行应该是“scope:‘email,publish_actions’”而不是“scope:‘email’”