钛 facebook 喜欢按钮
Posted
技术标签:
【中文标题】钛 facebook 喜欢按钮【英文标题】:Titanium facebook like button 【发布时间】:2015-04-18 15:18:52 【问题描述】:我尝试从我的 Titanium Alloy 应用程序中为页面发布点赞。
var fb = require('facebook');
fb.appid = "1234567890";
fb.permissions = ['public_profile', 'email', 'publish_actions'];
fb.addEventListener('login', function(e)
if (e.success)
Ti.API.info('LOGIN : Logged In');
else if (e.error)
Ti.API.info('LOGIN : ' + e.error);
else if (e.cancelled)
Ti.API.info('LOGIN : Canceled');
publishLike();
);
function publishLike()
var dict =
access_token : fb.getAccessToken()
;
fb.requestWithGraphpath('/' + 'somePageId' + '/likes', dict, 'POST', function(e)
if (e.success)
Ti.API.info('publishLike : Success!');
else
if (e.error)
Ti.API.info('publishLike : ' + e.error);
else
Ti.API.info('publishLike : Unkown result');
);
但应用调用API时出现错误:
[ERROR] : FacebookModule: (Thread-1559) [9475,21411] Request error for '/somePageId/likes' call: (#3) Application does not have the capability to make this API call.
[ERROR] : FacebookModule: com.facebook.android.FacebookError: (#3) Application does not have the capability to make this API call.
[ERROR] : FacebookModule: at com.facebook.android.Util.parseJson(Util.java:303)
[ERROR] : FacebookModule: at facebook.TiRequestListener.onComplete(TiRequestListener.java:88)
[ERROR] : FacebookModule: at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:276)
[INFO] : publishLike : (#3) Application does not have the capability to make this API call.
你有任何想法如何发布吗?
【问题讨论】:
【参考方案1】:根据this answer,您不能喜欢来自 Graph API 的页面。那是因为您只能通过 API 点赞 Open Graph 对象,而页面不是 Open Graph 对象。
【讨论】:
以上是关于钛 facebook 喜欢按钮的主要内容,如果未能解决你的问题,请参考以下文章