fb.authorize()永远不会给出登录事件 [英] fb.authorize() never give a login event

查看:71
本文介绍了fb.authorize()永远不会给出登录事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用来自appcelerator文档的代码,如下所示:

I am using the code from the appcelerator docs like this:

var fb = require('facebook');

fb.addEventListener('login', function(e) {

    Ti.API.info("Login event received...");

    if (e.success) {
        alert('login from uid: '+e.uid+', name: '+ JSON.parse(e.data).name);
    }
    else if (e.cancelled) {
        // user cancelled
        alert('cancelled');
    }
    else {
        alert(e.error);
    }
});

Ti.API.info("fb authorize...");
fb.permissions = ['public_profile'];
fb.initialize();
fb.authorize();

但是登录事件从不触发,什么也没有发生.有人知道为什么吗?

But the login event is never fired and nothing happens. Anyone have any idea why?

我正在iPhone上使用Appcelerator Studio 5.2.2.GA和iOS 9.3.1.

I am using appcelerator studio 5.2.2.GA and iOS 9.3.1 on iPhone.

推荐答案

请阅读 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆