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 8153637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:05:07+00:00 2026-06-06T16:05:07+00:00

I’m having trouble implementing the Facebook SDK in an iOS project and I suspect

  • 0

I’m having trouble implementing the Facebook SDK in an iOS project and I suspect that this line is to blame:

[facebook authorize:permissions delegate:self];

When I try to run it in my ARC project, it will not allow the delegate:self to remain. Instead it says there is an “ARC Error: no visible @interface for ‘Facebook’ declares the selector ‘authorize:delegate:'”

I can compile with this:

[facebook authorize:permissions];

but I don’t think Facebook and the app communicate properly by doing so. I am able to login, but once redirected back to my app, the app does not register that it is logged in and can’t execute any of its sharing functions.

I think I need to maintain that page as ARC enabled, so setting a flag to -fno-objc-arc won’t resolve this.

Any thoughts?


FOLLOWUP 4/5/12:

I was able to successfully implement Facebook… but using just the popup login method in app. Here’s how I made it happen (just FB aspects show):

My app delegate header:

#import "FBConnect.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate>{

    Facebook *facebook;

}

@property (nonatomic, strong) Facebook *facebook;

@end

App delegate method, included:

////FB ELEMENT: IMPORTING VC TO CONNECT WITH FACEBOOK
#import "ViewController.h"

////FB ELEMENT
@synthesize facebook;

///////FB ELEMENTS
// THIS METHOD SUPPORTS IOS PRE 4.2
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{

    NSLog(@"handleOpenURL called.");

    return [facebook handleOpenURL:url];

}

// THIS METHOD SUPPORTS IOS AFTER 4.2
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{

NSLog(@"openURL called.");

return [facebook handleOpenURL:url];
}

Then I wanted the bulk of the Facebook activity to be on the page calling it. Here is the header:

#import "FBConnect.h"

@interface ViewController : UIViewController <FBSessionDelegate, FBDialogDelegate>

//FB ELEMENTS
Facebook *facebook;
BOOL login;

//////SHARE PROPERTIES FOR PHOTO DISPLAY LAYER
@property (nonatomic, strong) Facebook *facebook;

And on the view controller’s method:

@synthesize facebook;

////////////////////////////////////////////

-(void)postWall{

    NSLog(@"postWall called.");

    //CREATING MORE ACCESSIBLE VARIABLE
    NSString *photoTitle = [photoTitles objectAtIndex:pt];


    //ESTABLISHES DESCRIPTION CONTENT
    NSDictionary *itemDescriptionPre = [photoDescriptions objectAtIndex:pt];
    NSString *itemDescription = [itemDescriptionPre objectForKey:@"_content"];

    NSMutableDictionary *paramsSet = 
    [NSMutableDictionary dictionaryWithObjectsAndKeys:

     //CLICKABLE LINK COMPONENT (STORY TITLE WORKS WELL HERE)
     photoTitle, @"name",

     //STORY DESCRIPTION GOES HERE
     itemDescription, @"description",

     //STORY LINK GOES HERE
     [flickrURLLink objectAtIndex:pt], @"link",

     //PHOTO TO CONNECT WITH POST
     [photoURLsLargeImage objectAtIndex:pt], @"picture",
     nil];  

    [[self facebook] dialog:@"feed" andParams:paramsSet andDelegate:self];

}

- (void) fbDidLogin {

    facebook = [[Facebook alloc] initWithAppId:@"MY_APP_ID" andDelegate:self];

    login = YES;

    NSLog(@"Logged in with Facebook credentials");

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
    [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationKey"];
    [defaults synchronize];

    [self postWall];
}

- (void)fbDidNotLogin:(BOOL)cancelled{
    ///TO COMPLETE
}

- (void)fbDidExtendToken:(NSString*)accessToken
               expiresAt:(NSDate*)expiresAt{
    ////TO COMPLETE
}


- (void)fbDidLogout{

    login = NO;
    NSLog(@"Logged out with Facebook credentials");
}

- (void)fbSessionInvalidated{

    login = NO;

    NSLog(@"Logged out with Facebook credentials");
}

After setting those up, I made sure I added the app ID into the plist as described by the Facebook tutorial and all worked as expected.

I am aware that the BOOL login value doesn’t affect anything yet.

My current problem with this code is a compatibility problem before 5.1.

It works great in my 5.1 test device and simulator, but does not do anything after the login step if I go to 5.0 or below. Any idea why that would be the case? I am able to enter my login data, then returned to the app, but not presented any more options.

Thanks for all your feedback so far. Would love to hear your thoughts on this item as well.

  • 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-06T16:05:09+00:00Added an answer on June 6, 2026 at 4:05 pm

    I was able to successfully implement Facebook… but using just the popup login method in app. Details were added as an edit to my original post.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I know there's a lot of other questions out there that deal with this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.