iOS Facebook SDK“用户取消登录”在设备上运行应用程序? [英] iOS Facebook SDK "user cancelled login" when running app on device?

查看:533
本文介绍了iOS Facebook SDK“用户取消登录”在设备上运行应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的iOS Facebook SDK,当我在模拟器中运行我的应用程序时,我可以完美地登录和退出(在这种情况下,它会打开非本机弹出窗口,因为未安装facebook应用程序),但是当我在我的设备上运行它时,我得到了原生的uialertview弹出窗口,当我点击确定时,终端显示用户取消登录,弹出窗口解除但是它没有登录。你知道什么可能是引起这个?我做了一些研究,找不到任何东西。我几乎跟着他们的示例应用程序Scrumptious到这封信,我无法弄清楚为什么它适用于该应用程序而不是我的。

I'm using the latest iOS Facebook SDK and I can log in and out perfectly when I am running my app in the simulator (in which case it opens the non-native popup window because the facebook app is not installed), but when I run it on my device I get the native uialertview popup and when I click "ok", the terminal says "user cancelled login" and the popup dismisses but it doesn't log in. Do you have any idea what could be causing this? I have done some research and couldn't find anything. I have pretty much followed their example app "Scrumptious" to the letter and I can't figure out why it works for that app but not mine.

推荐答案

除了错误的捆绑,不处理Facebook回调也是一个原因。在app delegate中添加下面提到的方法。

Apart from wrong bundle, not handling Facebook callback can be a reason too. Add below mentioned method in app delegate.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                      openURL:url
                                            sourceApplication:sourceApplication
                                                   annotation:annotation];
}

这篇关于iOS Facebook SDK“用户取消登录”在设备上运行应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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