application open Url method not called after user authenticates the facebook

隐身守侯 提交于 2020-01-01 11:49:33

问题


I have upgraded the facebook in my ios app to 3.0 and using the code provided at https://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk/ for user login through facebook , but the problem is that the after the user allows the facebook access the - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation method is not being called. But the interesting part is that when i create a new application and integrate the same code in that application the same method is being called there.I am using xcode 4.4. Any suggestion why is it happening with my existing code.


回答1:


make sure you are have set the fburl, and appid well. If the device/simulator having more than apps which are using same facebook appId it may happen.




回答2:


Could this possibly be because your old app is set to not run in the background, as set in your app plist? I have been having this same problem. It seems that, if the app is left running in the background, it will return and call openURL. But if the app does not run in the background, it will return and call application:didFinishLaunchingWithOptions instead, and NOT call openURL. It is possible to get the url from the launch options:

NSURL *url = [launchOptions objectForKey: UIApplicationLaunchOptionsURLKey];

but I have not figured out how to call this so that it has the same effect as application:openURL when returning from Facebook authentication. Hope this helps some.




回答3:


updated the xcode to 4.5 GM for correct working , may be it was a problem with xcode previous version.



来源:https://stackoverflow.com/questions/12515922/application-open-url-method-not-called-after-user-authenticates-the-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!