I am trying to implement the new oKuth2 facebook SDK in my application, but I canβt understand for life how I should return to my application after login / authentication.
My goal is to post a message on the users wall.
I am currently starting the login procedure:
-(void)tryFBlogin { NSString *appId = @"113142482******"; NSArray *permissions = [[NSArray arrayWithObjects:@"publish_stream",nil] retain]; TheAppDelegate *theAppDelegate = (TheAppDelegate *)[[UIApplication sharedApplication]delegate];
which opens the Safari browser. If I have already logged in and received the permission of the application, this will tell me about it, and I have an OKay button for pressing.
When I click OKay, I get a warning that safari cannot open the page. I acknowledge the warning and remain staring at the empty safari window.
If I log out of facebook, I will be presented with a login screen, which I fill out, and then will be presented in the same way as above.
I understand that I have not yet implemented the publish command, but I do not know where / when this should be implemented.
I have this delegate method, but it seems to never be called
- (void)fbDidLogin { NSLog(@"fbDidLogin"); }
This is the code I expect somewhere somewhere:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: kAppId, @"113142482******", facebookUrl, @"link", @"http://www.domain.com", @"picture", @"My Message", @"name", @"Caption text!", @"caption", @"Message text.", @"message", nil]; [facebook dialog:@"feed" andParams:params andDelegate:self];
I also have the following methods in the main AppDelegate application:
-(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url{ [facebook handleOpenURL:url]; return YES; }
Any help / suggestions would be greatly appreciated.
thanks
Mark