iOS Facebook SDK "user cancelled login" when running app on device?

Att*_*Fun 2 facebook ios facebook-ios-sdk ios7

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.

iHu*_*ulk 7

除了错误的捆绑,不处理Facebook回调也是一个原因.在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];
}
Run Code Online (Sandbox Code Playgroud)


pro*_*tor 5

尝试在您创建 appID 的 developer.facebook.com 上添加您的应用程序的包标识符。并确保您的应用程序的捆绑标识符和您输入的两者相同。!同样在移动设置中检查您是否有权访问您的应用程序。在这里,您必须添加您的包标识符并保存更改。

希望它会起作用。