Skip to content

facebook/facebook-ios-sdk – GitHub

facebook/facebook-ios-sdk – GitHub.

I’m checking out this SDK for Facebook integration for an app.

In starting it up, it launched Safari to do the authorization, but then got an error when trying to go back to the app (though I setup the appid as it directed).

I found this post in the issues and tried changing the line in Facebook.m as it mentions. It worked, but not if I have the facebook app on my device.

I set them both to NO…

[self authorizeWithFBAppAuth:NO safariAuth:NO];

… and it brought up the Facebook auth page and remained in the app (as opposed to launching the fb app).

UPDATE: The URL schema needs to be fb[appid] where the full [appid] is replaced like fb123123123 or similar.

5 thoughts on “facebook/facebook-ios-sdk – GitHub”

  1. will check this solution out on device tomorrow
    some people say the ‘safari’ window is replaced by the actual application if this one is installed.

    anyway, still looking how to fetch the USER NAME and post it in a stream…. 🙁
    any chance you might now this?

    1. Yes, it’s replaced by the app if it’s installed.
      My concern at this point is that it seems to load the app even if the user has already logged in and given permissions.
      It just loads and has an ‘okay’ button.
      let me know if you check it out and how it goes. I haven’t looked into the app/safari loading thing, but intend to get back to it.

  2. Using similar code to the demo app here:
    https://github.com/facebook/facebook-ios-sdk/blob/master/sample/DemoApp/Classes/DemoAppViewController.m

    -(void)requestMyData;
    {
    [_facebook requestWithGraphPath:@”me” andDelegate:self];
    }

    The result passed into the callback is an NSDictionary of the user data:

    – (void)request:(FBRequest *)request didLoad:(id)result {
    if ([result isKindOfClass:[NSArray class]]) {
    result = [result objectAtIndex:0];
    }
    // do what you like to the result as a dictionary here
    };

    Printed to the log…

    Printing description of result:
    {type = mutable dict, count = 17,
    entries =>
    0 : {contents = “id”} = {contents = “7475…10”}
    1 : {contents = “timezone”} = -6
    2 : {contents = “quotes”} = {contents = “”Live every week like it’s Shark Week.””}
    3 : {contents = “link”} = {contents = “http://www.facebook.com/xyz”}
    4 : {contents = “locale”} = {contents = “en_US”}
    6 : {contents = “education”} = (
    {
    school = {
    id = 11256769209… and so on.

Comments are closed.