fbDidLogin未调用 [英] fbDidLogin not called

查看:109
本文介绍了fbDidLogin未调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我一直在乱写Facebook iOS SDK一段时间,而最新的版本我无法得到被调用的fbDidLogin方法。登录过程工作正常,在模拟器上使用Safari,并在设备上运行时使用Facebook应用程序。但是,登录后,我被转回到我的应用程序(我应该),但是因为没有调用fbDidLogin方法,所以没有任何改变。就我的应用程序而言,我没有登录。
与SDK捆绑在一起的演示程序工作正常。所以我显然做错了,但我不知道如何检查什么。我三次检查了演示应用程序中使用的所有方法对我自己的,只要我看到一切看起来都一样。任何关于如何调试的想法或想法?或者有人有类似的问题吗?

So, I've been messing around with the Facebook iOS SDK for a bit and as of the latest version I can't get the fbDidLogin method to be called. The login process works fine, with Safari used on the simulator and the Facebook app being used when running it on a device. However, after logging in I get transferred back to my app (as I should be) but as the fbDidLogin method hasn't been called, nothing has changed. As far as my app is concerned I'm not logged in. The demo app that is bundled with the SDK works fine. So I'm obviously doing something wrong, but I have no idea how to check what. I triple-checked all the methods used in the demo app against my own and as far as I can see everything looks the same. Any thoughts or ideas on how to debug this? Or has anyone had similar problems?

谢谢!

推荐答案

遇到了同样的问题。我通过将以下代码添加到我的应用程序委托中来解决:

I encountered the same issue just now. I solved it by adding the following code into my application delegate:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [[controller facebook] handleOpenURL:url];
}

其中controller是我的 UIViewController 实例和Facebook是我的 Facebook 实例。

where controller is my UIViewController instance and facebook is my Facebook instance.

您还需要注册您的应用程序来处理您的fb应用程序URL方案(在您的Info.plist中进行)。

You also need to register your app to handle your fb application's URL scheme (do that in you Info.plist).

这篇关于fbDidLogin未调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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