0

Custom Log in to facebook in ios application

I was working through this. I have succeeded to a great extent, except that when i try to logout from facebook, the fb sdk presents a UIActionSheet which has logout and cancel options. My app is in landscape mode. But the action sheet opens up in portrait mode instead of landscape, and that too starting somewhere from the middle of the screen, such that logout button goes out of bounds. On;y half of cancel button is visible, and clicking on logout does logout from facebook.

I want to open that action sheet in landscape mode, but I don't even have the object for that sheet.

PS: I am using latest ios sdk.

Community
  • 1
  • 1
neeraj
  • 1,191
  • 4
  • 19
  • 47
  • There's a HelloFacebookSample packaged with the SDK. Are you seeing similar behavior with that app? If not, you may want to take a look at any differences. I tried the sample app and put it in landscape mode. Clicking Logout showed the UIActionSheet okay. – C Abernathy Oct 06 '12 at 02:15
  • i have referred to the sample app, and it worked fine. It works fine if I present a different view controller for putting the fbloginview and the post photo buttons. But now what I am doing is this: I have a view controller. I have one more view controller which I do not present, but it contains all methods and properties related to facebook sdk. the second view controller is also the delegate for fbloginview. I present an action sheet in the 1st vc, which has the login to facebook option. after that I present the next action sheet which has logout and post photo option. – neeraj Oct 06 '12 at 06:15
  • Post photo works fine, but logout needs to present one more action sheet which sdk produces. That action sheet now gets clipped. To produce the custom login and logout instead of using fbloginview, i am doing this http://stackoverflow.com/questions/12705409/custom-log-in-to-facebook-in-ios-application I think something goes wrong if I call `sendActionsForControlEvents:` on the `fbloginview` – neeraj Oct 06 '12 at 06:18
  • It would help if you show some of the relevant code. It wasn't clear whether or not you're using FBLoginView. You say you are at one point then not in another. – C Abernathy Oct 10 '12 at 01:42
  • I make a instance of `FBLoginView` in one class. Since it is a UIView, I search all its subviews and find a UIButton. I call `sendActionsForControlEvents:` on that button which triggers the same actions as if a user has tapped on the FBLoginView. I call the `sendActionsForControlEvents:` when I want to login or logout. I make the fbloginview instance in one view controller, and call the `sendActionsForControlEvents:` from its parent view controller – neeraj Oct 10 '12 at 09:10

0 Answers0