未调用 fbDidLogin [英] fbDidLogin not called

查看:15
本文介绍了未调用 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];
}

控制器是我的 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天全站免登陆