简体   繁体   English

iOS Facebook本机共享对话框:初始文本

[英]iOS Facebook Native Share Dialog : initial text

I'm using Facebook Native Share Dialog in my iOS app. 我在iOS应用中使用“ Facebook本机共享对话框”。 I give the initial text, but when dialog pop up, it add the post URL to my initial text. 我提供了初始文本,但是当对话框弹出时,它将帖子URL添加到了我的初始文本中。 How can I solve this problem? 我怎么解决这个问题? Here the code. 这里的代码。

BOOL displayedNativeDialog =
    [FBNativeDialogs
     presentShareDialogModallyFrom:self
     initialText:@"Say something about this..."
     image:[UIImage imageWithData:imageData]
     url:[NSURL URLWithString:activityUrl]
     handler:^(FBNativeDialogResult result, NSError *error) {
         if (error) {
         } else {
             if (result == FBNativeDialogResultSucceeded) {
             } else {
             }
         }
     }];

If you're sharing a URL (link share) and the image is inside that link, then just set the image parameter to nil. 如果您共享一个URL(链接共享),并且图像位于该链接内部,则只需将image参数设置为nil。 Then the post URL will not be added to the initial text. 这样,发布网址将不会添加到初始文本中。 If you provide an image, it's as if you're sharing a photo and adding the link (and text) as photo caption info. 如果提供图像,就好像您要共享照片并添加链接(和文本)作为照片标题信息一样。

So based on what you're trying to do, select the option that works for you, ie is it a link share or a photo share. 因此,根据您要执行的操作,选择适合您的选项,即是链接共享还是照片共享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM