Я только что интегрировал facebook в свое приложение через ios 6, но у меня проблема при публикации на стене. Он просто говорит "сообщение через приложение ios. Я хочу, чтобы он сказал ", отправленный через имя приложения. Я сделал идентификатор приложения с facebook, и у меня есть номер приложения, который они назначили, но я не уверен, как интегрировать его с интеграцией facebook.
Ниже мой код. Если бы кто-нибудь мог помочь, это было бы оценено. Спасибо!
{
NSString *message;
message= [[NSString alloc] initWithFormat:@"I've earned %@ points", [self retrieveScore]];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText:message];
[controller addURL:[NSURL URLWithString:@"http://mysite"]];
[self presentViewController:controller animated:YES completion:Nil];
[message release];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
NSString *output= nil;
switch (result) {
case SLComposeViewControllerResultCancelled:
output= @"Action Cancelled";
NSLog (@"cancelled");
break;
case SLComposeViewControllerResultDone:
output= @"Post Succesfull";
NSLog (@"success");
break;
default:
break;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Facebook" message:output delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
}