共享时,UIActivityViewController 不会在 Facebook 上显示 link
UIActivityViewController does not show link over facebook when shared
当我在 facebook 上使用共享功能时,我看不到字符串和 link,下面是示例代码。
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text."], [NSURL URLWithString:@"http://www.google.com"]];
NSArray * applicationActivities = nil;
NSArray * excludeActivities = @[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeMessage];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
activityController.excludedActivityTypes = excludeActivities;
[self presentViewController:activityController animated:YES completion:nil];
你的 link 在那里,但它没有作为你的 post 文本的一部分内联显示。相反,它被视为类似附件的预览:
如果您想在文本中看到您的 link,请将其添加到您的 NSString
activity 项目中:
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text. An inline link http://www.yahoo.com"]];
这样你会看到字符串和 link:
你Link必须是一个NSURL对象:
NSString *link = @"http://itunes.apple.com/app/id00000000";
NSArray *activityItems = @[ [NSURL URLWithString: link] ];
当我在 facebook 上使用共享功能时,我看不到字符串和 link,下面是示例代码。
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text."], [NSURL URLWithString:@"http://www.google.com"]];
NSArray * applicationActivities = nil;
NSArray * excludeActivities = @[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeMessage];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
activityController.excludedActivityTypes = excludeActivities;
[self presentViewController:activityController animated:YES completion:nil];
你的 link 在那里,但它没有作为你的 post 文本的一部分内联显示。相反,它被视为类似附件的预览:
如果您想在文本中看到您的 link,请将其添加到您的 NSString
activity 项目中:
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text. An inline link http://www.yahoo.com"]];
这样你会看到字符串和 link:
你Link必须是一个NSURL对象:
NSString *link = @"http://itunes.apple.com/app/id00000000";
NSArray *activityItems = @[ [NSURL URLWithString: link] ];