Facebook iOS Application Cannot Log In On Device
This is a very frustrating issue. The DemoApp project from the iOS SDK from Facebook works just fine on the simulator but when I put it on the device it won't get past the log in page. The only changes made to the code were:
1) Replaced the appID in the view controller 2) Replaced the appID in the Info plist
The application compiles and opens on the device. The login button switches to a Facebook titled window with a Cancel button in the upper right corner. The window has a large blue Log In button at the bottom. Clicking on the Log In button redirects to the same window. This is the only Facebook iOS app on the device. I deleted the others. Also, the fbDidNotLogin() method is never called. There have been several other posts about this issue but the solutions didn't seem to work in this case. Is this enough inf开发者_开发百科ormation to see what is happening? Do I need to build the application for a different target? This is very confusing. Thanks for your help!
Found it! In Facebook.m is the following line of code:
[self authorizeWithFBAppAuth:YES safariAuth:YES];
The iOS SDK will try to use the Facebook application on the device. Setting authorizeWithFBAppAuth to NO will launch Safari and that works.
1) Replaced the appID in the view controller 2) Replaced the appID in the Info plist
You should set "iOS Bundle ID" in application settings too. this is checked before authorization.
hope this helps
精彩评论