1
votes

In my app am using Facebook api and in my device am having Facebook app(FBApp) also. In my app i provided a button to login when we click on button it is opening FBApp login screen and after that it is coming to my app. Here the following methods are not firing

-(void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response -(void)request:(FBRequest *)request didLoad:(id)result

This is the button action

- (IBAction)LoginOrLogout 
{
// If the user is not connected (logged in) then connect.  Otherwise logout.
if (!isConnected)
{
    [messageTextField setHidden:NO];
    [facebook authorize:permissions];
    // Change the lblUser label's message.
    **[lblUser setText:@"Please wait..."];** //struck here only not firing delegate response methods above
}
else 
{
    [facebook logout:self];
    [messageTextField setHidden:YES];
    [lblUser setText:@"Tap on the Login to connect to Facebook"];
}
isConnected = !isConnected;
[self setLoginButtonImage];
}

Without FBApp it is calling delegate methods successfully.How can we solve this. Any one can help or suggest.

2
have you tried with: something like "[facebook setDelegate:self]"?Marco Pace
Not working and showing Facebook not responds to setDelegate:Kalyan Andra

2 Answers

1
votes

Actually when you tap on authorize then it will open safari or if there is facebook app on device then it will open facebook app otherwise it will open facebook in safari. If you don't want to open the safari and facebook app then in facebook.m change this statement everywhere where it is calling to NO.

[self authorizeWithFBAppAuth:NO safariAuth:NO];
0
votes

I was only able to receive those notifications on the AppDelegate class. I tried to create an util class that could be plugged in every project so it could help people using the Facebook API. The problem is that even tho I set the delegate to my util class, the delegate's methods were never called. Try to put then on the AppDelegate..