Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9190201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:24:26+00:00 2026-06-17T20:24:26+00:00

In my Iphone app i’m using facebook sdk 3.1. I want to redirect facebook

  • 0

In my Iphone app i’m using facebook sdk 3.1. I want to redirect facebook login page first. after login again redirect to my app.

And also i want to get facebook friends list from friendspickercontroller when i don’t login facebook in settings in iphone.

i’m using this code

Facebook login:

-(IBAction)facebookButtonPressed:(id)sender
{
NSLog(@" hi im ");

NSArray *permissions =
[NSArray arrayWithObjects:@"user_photos", @"friends_photos",@"email", nil];

[FBSession openActiveSessionWithReadPermissions:permissions
                                   allowLoginUI:YES
                              completionHandler:
 ^(FBSession *session,
   FBSessionState state, NSError *error) {

     if(!error)
     {
         NSLog(@" hi im sucessfully lloged in");
         [self sessionStateChanged:session state:state error:error];
     }
 }];

}


- (BOOL)application:(UIApplication *)application
        openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation
{
   return [FBSession.activeSession handleOpenURL:url];
}


- (void)sessionStateChanged:(FBSession *)session
                  state:(FBSessionState) state
                  error:(NSError *)error
{

  switch (state) {
    case FBSessionStateOpen:
    {
        UIViewController *topViewController =
        [appDelegate.naviCon topViewController];
        if ([[topViewController modalViewController]
             isKindOfClass:[ViewController class]]) {
            [topViewController dismissModalViewControllerAnimated:YES];
        }
        NSLog(@"h im in state open 1111111");
        {
           NSLog(@"hi iam in open state9999999999999999999");
        }
    }
        break;
    case FBSessionStateClosed:
      {
          NSLog(@"iam in loginfailed 444444444444");
      }
    case FBSessionStateClosedLoginFailed:
          NSLog(@"iam in loginfailed 555555555555");

        NSLog(@"iam in statecloze 555555555555");
        [FBSession.activeSession closeAndClearTokenInformation];
        break;
    default:
        break;
}

if (error)
{

}
}

Getting frieds:

 NSArray *permissions =
    [NSArray arrayWithObjects:@"user_photos", @"friends_photos",@"email", nil];

    if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {            
        [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:YES    completionHandler: ^(FBSession *session, FBSessionState state, NSError *error)
        {
            if(!error)
            {
if (self.friendPickerController == nil)
            {
                self.friendPickerController = [[FBFriendPickerViewController alloc] init];
                self.friendPickerController.title = @"Pick Friends";
                self.friendPickerController.delegate = self;
            }
            [self.friendPickerController loadData];
            //[self.friendPickerController clearSelection];
            [self presentModalViewController:self.friendPickerController animated:YES];
}
}];
}

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:24:28+00:00Added an answer on June 17, 2026 at 8:24 pm

    you also need read_friendlists permission for getting friend list.

    then use

    -(void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker
    {
    
     NSArray *friends = friendPicker.selection;
    
    }
    

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my iphone app is using soap web-services. I want to know how it would
The iPhone app that I am working on requires GET calls to a 3rd
My iPhone app formats an NSDecimalNumber as a currency using setCurrencyCode, however another screen
When logging in from iphone app, I call a php script login function that
In my iphone app. I want to change the text size in a label
My iPhone app currently uses core data. I want to create an online database
When iPhone app is in background state or when app is minimized, I want
In iphone app i am using alertview to check the if textbox values is
My iphone app creates files using the my custom .ops extension. using NSDictionary. Nsdictionary
In iPhone App i am using core Plot vertical bar chart. How to Remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.