问题描述:

I want to make facebook publication on the iOS6. The way I do it:

  1. Ask for read permission
  2. Ask for publish permission
  3. Call [FBDialogs presentOSIntegratedShareDialog...]

It works but in feed I see "via iOS" and I want to see my app name instead. How can it be fixed? If I make publications with Feed Dialog (web based) - my application name is displayed correct

- (IBAction)facebookShareButtonTaped:(id)sender

{

[FBSession openActiveSessionWithReadPermissions:@[@"email"]

allowLoginUI:YES

completionHandler:^(FBSession *session, FBSessionState status, NSError *error)

{

if (status == FBSessionStateOpen)

{

[FBSession.activeSession requestNewPublishPermissions:@[@"publish_actions"] defaultAudience:FBSessionDefaultAudienceOnlyMe completionHandler:^(FBSession *session, NSError *error) {

[self sendFacebookPost];

}];

}

}];

}

- (BOOL)sendFacebookPost

{

BOOL dialogShown = [FBDialogs presentOSIntegratedShareDialogModallyFrom:self initialText:@"" image:nil url:nil handler:^(FBOSIntegratedShareDialogResult result, NSError *error) {

if (error && [error code] == 7)

{

return;

}

if (error)

{

[self showAlert:[self checkErrorMessage:error]];

}

else if (result == FBNativeDialogResultSucceeded)

{

[self showAlert:@"Posted successfully."];

}

}];

return dialogShown;

}

网友答案:

You can specify the name that should show up by adding a new entry to the Information Property List within your plist file. Just add the key FacebookDisplayName with the name you want as its value.

相关阅读:
Top