Facebook SDK сообщение на стене на iPhone приложение
У меня проблема с внедрением постов на Facebook в приложении для iPhone. Я установил SDK и связанный фреймворк логин работает нормально. вот код:
-(IBAction)loginButtonPressed:(id)sender
{
NSLog(@"loginButtonPressed: called");
AppDelegate *appdel=[[UIApplication sharedApplication] delegate];
appdel.facebookSession=[[FBSession alloc] init];
[appdel.facebookSession openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error)
{
//
}];
}
Но у меня проблема с размещением сообщения на стене пользователя. Вот код:
-(IBAction)likeButtonPressed:(id)sender
{
NSLog(@"likeButtonPressed: called");
// Post a status update to the user's feedm via the Graph API, and display an alert view
// with the results or an error.
NSString *message = @"test message";
NSDictionary *params = [NSDictionary dictionaryWithObject:message forKey:@"message"];
// use the "startWith" helper static on FBRequest to both create and start a request, with
// a specified completion handler.
[FBRequest startWithGraphPath:@"me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:message result:result error:error];
}];
}
Помоги мне, пожалуйста. Что не так с моим кодом? Или я должен добавить некоторые разрешения для входа в систему?