我正在使用提供一些默認文本和鏈接的UIActivityViewController。所有社交媒體(短信,電子郵件,推特)都會顯示默認文本和網址。但是,在顯示URL圖像時使用FB,默認文本不顯示(只是空白)。下面是代碼:面向Facebook的UIActivityViewController不顯示默認文本
NSString *shareStr = [NSString stringWithFormat:@""some text"];
NSURL *website = [NSURL URLWithString:@"website"];
NSArray *shareAray = @[shareStr,website];
[self viewWillDisappear:YES];
UIActivityViewController *activityController = [[UIActivityViewController alloc]initWithActivityItems:shareAray
applicationActivities:nil];
if([activityController respondsToSelector:@selector(popoverPresentationController)])
activityController.popoverPresentationController.barButtonItem = self.shareButton;
[self presentViewController:activityController
animated:YES completion:nil];
[activityController setCompletionHandler:^(NSString *activityType, BOOL completed){
if (!activityType || UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
[self viewWillAppear:YES];
}
}];
更新: 如前所述在別人下面說,FB不再允許預填充。以下是視頻的另一個鏈接,其中給出了允許和不允許的示例的示例:https://developers.facebook.com/docs/apps/review/prefill
我也發現這個問題與iOS 8.2。 – SanitLee
我在iOS 8.3上也看到了這個,你有問題編號@DanielStorm? – francis
只是爲了確認FB應用程序在這個問題上扮演重要角色。我沒有看到安裝上一個FB應用程序的問題,但最新的。正如@DanielStorm所說的,也許等待新的更新的FB應用程序。 – SanitLee