IOS: custom message FBSDKShareDialog

I create an FBSDKShareLinkContent object and load it into FBSDKShareDialog. I am trying to set the default message for the dialog to something like "my record is% d!". By itself, it works and has an empty message by default. can anyone help?

Thank you!

EDIT: here is my code snippet:

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()]; 
+5
source share
2 answers

It is not possible to set a default message using the sharing dialog offered by the SDK. He also considered prefilling and is against Facebook platform policies, see Section 2.3 https://developers.facebook.com/policy

+10
source

I found that the title and description are in any case related to the url object. This means that the message text above the object that the user sees in the sharing dialog cannot be affected, it seems.

Both the header and handle of the URL object only work if you set the dialog mode to Native or FBSDKShareDialogModeFeedBrowser.

 dialog.mode = FBSDKShareDialogModeNative; if (![dialog canShow]) { dialog.mode = FBSDKShareDialogModeFeedBrowser; } 

Another thing, there is some property FBSDKShareLinkContent, called "quote", which displays text on top of the URL object and the message itself, but does not appear in all modes. For example, not in Native, but yes in FBSDKShareDialogModeFeedBrowser.

 FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init]; content.contentURL = [NSURL URLWithString:@"http://www.x.com"]; content.contentDescription = @"desc"; content.contentTitle = @"title"; content.quote = @"quote"; 
+1
source

Source: https://habr.com/ru/post/1216462/


All Articles