Facebook iOS - handleOpenURL & Tabbar app

I am having difficulty logging into Facebook to enter the correct viewing mode in the application and invoking the corresponding facebook functions.

In the Facebook example, there’s just [controller facebook] where they start. I use the tab app, although I don’t have the required link. I made a pointer to the desired view and used it ... it was opened correctly, but did not call any methods related to facebook, in particular:

(void)fbDidLogin;

(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [[*NotReferencedViewController* facebook] handleOpenURL:url];
}

Anyone else run into this?

+2
source share
1 answer

, , Facebook , , UIApplicationDelegate. , , :

[[UIApplication sharedApplication] delegate].facebook

, facebook , .

-

NSArray* permissions =  [[NSArray arrayWithObjects:@"email", @"read_stream", @"publish_stream", nil] retain];

[facebook authorize:permissions delegate:self];

delegate:self , , Facebook , . - fbDidLogin, , :

-(void)authorizeFacebook {
    NSArray* permissions =  [NSArray arrayWithObjects:@"email", @"read_stream", @"publish_stream", nil];

    [facebook authorize:permissions delegate:self];
}

// if the authorization succeeds it will come back to your app and call the method below
-(void)fbDidLogin {
    // switch view, call the facebook graph, or do whatever else you like
}

.

facebook, .h facebook SDK: Facebook.h, FacebookRequest.h ..

Edit

handleOpenURL: , fb ( , URL):

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {

    return [facebook handleOpenURL:url]; 
}

http://developers.facebook.com/docs/guides/mobile/#ios

+2

All Articles