【问题标题】:Titanium facebook like button钛 facebook 喜欢按钮
【发布时间】: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.

你有任何想法如何发布吗?

【问题讨论】:

    标签: javascript android titanium facebook-like


    【解决方案1】:

    根据this answer,您不能喜欢来自 Graph API 的页面。那是因为您只能通过 API 点赞 Open Graph 对象,而页面不是 Open Graph 对象。

    【讨论】:

      猜你喜欢
      • 2012-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多