我在我的項目中添加了UIActivityController
。看起來對於這個特定主題的幫助很少。我面臨的問題是鏈接在Facebook上以奇怪的方式分享,而不是通常在Facebook上共享的方式。更有意義的是,照片和鏈接將在iOS照片文件夾中進行更改,而無需任何選項進行更改。UIActivityController在Facebook上發佈
下面是示例圖像如何,他們目前得到在Facebook上共享:
如何,它們通常在Facebook上共享,我想:
這裏我正在使用的代碼添加UIActivityController在我的項目中:
UIActivityViewController *objVC = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:titleString, [NSURL URLWithString:urlString], imageTaker, nil] applicationActivities:nil];
[self presentViewController:objVC animated:YES completion:nil];
[objVC setCompletionHandler:^(NSString *activityType, BOOL completed)
{
NSLog(@"Activity = %@",activityType);
NSLog(@"Completed Status = %d",completed);
if (completed)
{
UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Posting was success" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[objalert show];
objalert = nil;
}else
{
UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Posting was not successful" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[objalert show];
objalert = nil;
}
}];
除此之外,我也接受控制檯一些警告其如下:
Registering unknown app identifier com.apple.mobilemail failed
Unable to find app identifier com.apple.mobilemail
Registering unknown app identifier com.apple.MobileSMS failed
Unable to find app identifier com.apple.MobileSMS
更新:我也試圖整合REActivityController
,一個庫來實現同樣的事情,但有額外的功能,但我面臨同樣的問題。
謝謝,它工作正常,但我需要在活動視圖控制器上顯示視頻縮略圖作爲共享時的附件。我怎樣才能做到這一點? – 2013-06-19 08:24:26