gpt4 book ai didi

ios - 共享时 UIActivityViewController 不显示 facebook 上的链接

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:13:18 25 4
gpt4 key购买 nike

当我在 facebook 上使用分享功能时,我看不到字符串和链接,下面是示例代码。

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];

最佳答案

你的链接必须是一个 NSURL 对象:

NSString *link = @"http://itunes.apple.com/app/id00000000";
NSArray *activityItems = @[ [NSURL URLWithString: link] ];

关于ios - 共享时 UIActivityViewController 不显示 facebook 上的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34037163/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com