美文网首页iOS开发.iOS Developer
集成各种分享..我的蛋疼

集成各种分享..我的蛋疼

作者: 侭情显現 | 来源:发表于2017-01-17 20:53 被阅读203次

    之前使用的是友盟分享5.几的.但是自定义分享一直导致控制器销毁不了.后来友盟集成了6.0版本.我们也开始集成最新的友盟分享sdk.添加了vk.以及whatsapp.还是挺方便的.遇到两个问题.记录一下.

    1.twitter 出现: status is a duplicate.因为测试.分享到twitter一直是一样的数据.其他平台分享同样的数据多次不会有问题.但是twitter就不允许.各位看官注意了

    AF04605D%40BB882079.AB997B58_recompress.jpg

    2.facebook.出现** "(#200) The user hasn't authorized the application to perform this action"**问题.

    A428BCE6%40BB882079.AB997B58_recompress.jpg

    没有找到解决方案.是少了令牌什么的.最终使用了facebook的分享方案:

    分享网页:

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

    第二个问题:有什么好的思路.可以提供给我.不胜感激...

    相关文章

      网友评论

        本文标题:集成各种分享..我的蛋疼

        本文链接:https://www.haomeiwen.com/subject/weqvbttx.html