之前使用的是友盟分享5.幾的.但是自定義分享一直導(dǎo)致控制器銷毀不了.后來友盟集成了6.0版本.我們也開始集成最新的友盟分享sdk.添加了vk.以及whatsapp.還是挺方便的.遇到兩個問題.記錄一下.
1.twitter 出現(xiàn): status is a duplicate.因?yàn)闇y試.分享到twitter一直是一樣的數(shù)據(jù).其他平臺分享同樣的數(shù)據(jù)多次不會有問題.但是twitter就不允許.各位看官注意了
2.facebook.出現(xiàn)** "(#200) The user hasn't authorized the application to perform this action"**問題.
沒有找到解決方案.是少了令牌什么的.最終使用了facebook的分享方案:
分享網(wǎng)頁:
NSURL *url = [NSURL URLWithString:url1]; FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init]; content.contentDescription = text; content.contentTitle = [title stringByAppendingString:@" "]; content.quote = text; content.contentURL = url; content.imageURL = imgURL; FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init]; shareButton.shareContent = content; FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc]init]; dialog.fromViewController = self; dialog.shareContent = content; dialog.mode = FBSDKShareDialogModeFeedBrowser; dialog.delegate = self; [dialog show];
分享圖片
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init]; FBSDKSharePhoto * photo = [FBSDKSharePhoto photoWithImage:img userGenerated:YES]; content.photos = @[photo]; FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init]; shareButton.shareContent = content; [FBSDKShareDialog showFromViewController:self withContent:content delegate:self];
第二個問題:有什么好的思路.可以提供給我.不勝感激...