Search code examples
iosfacebook-ios-sdkfacebook-share

iOS: FBSDKShareDialog custom message


I'm creating the FBSDKShareLinkContent object and feeding it into the FBSDKShareDialog. I'm trying to set up the dialog's default message to something like "my highscore is %d !". sharing itself is working and has an empty message by default. can anyone help please?

thank you!

EDIT: here is my piece of code:

FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString: @"https://itunes.apple.com/us/app/cylinder-game"];
content.contentTitle = @"Cylinder Game";
content.contentDescription = @"Cylinder Game is endless, rhythm based game with super addictive gameplay";

FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
[dialog setMode:FBSDKShareDialogModeAutomatic];
[dialog setShareContent:content];
[dialog setDelegate:self];
[dialog setFromViewController:UnityGetGLViewController()];

Solution

  • There's no way to set the default message using the share dialog offered by the SDK. It's also considered prefilling, and is against the Facebook Platform Policy, see section 2.3 https://developers.facebook.com/policy