Диалоговое окно facebook не запускается из обработчика представления предупреждений.
Но диалог Facebook запускает ОК с кнопки.
Код запуска диалога Facebook следующий
- (void) share_on_facebook
{
_facebook = [[Facebook alloc] initWithAppId:kAppId];
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_facebook dialog:@"feed" andParams:params andDelegate:self];
}
Обработчик вида предупреждений - нажатие кнопки
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
[self share_on_facebook];
}
Диалоговое окно facebook не запускается, но когда я вызываю share_on_facebook из обычного обработчика нажатия кнопки, диалоговое окно открывается успешно.
Пожалуйста, помогите разобраться в проблеме.