zoukankan      html  css  js  c++  java
  • 友盟分享的坑

    1、签名一致

    2、ios设置Info里shemas

    3、新碰到的问题

    先分享链接的,再分享纯图片就不行

    反过来也一样

    不知道是什么原因

    ===

    终于搞定,分享链接和分享图片,2步接着操作导致图片不能分享崩溃的问题了。

    要定义[UMSocialData defaultData] +initWithIdentifier不同的id

    //分享链接的

     UMSocialData *socialData =[[UMSocialData defaultData] initWithIdentifier:@"identifierLink"];// [UMSocialData defaultData initWithIdentifier:@"A Book Named BILI"];

     

    //分享图片的

        UMSocialData *socialData =[[UMSocialData defaultData] initWithIdentifier:@"identifierImg"];// [UMSocialData defaultData initWithIdentifier:@"A Book Named BILI"];

    这样,不管是先分享链接,还是先分享图片。都正常了。

    ========

    参考

    - (IBAction)shareAction:(UIBarButtonItem *)sender
    {
    if (!_shareInfo)
    {
    return;
    }
    UMSocialData *socialData = [UMSocialData defaultData];
    socialData.extConfig.qqData.title = _shareInfo.title;
    socialData.extConfig.qqData.url =_shareInfo.url;

    socialData.extConfig.qzoneData.title = _shareInfo.title;
    socialData.extConfig.qzoneData.url = _shareInfo.url;


    socialData.extConfig.wechatSessionData.title = _shareInfo.title;
    socialData.extConfig.wechatSessionData.url = _shareInfo.url;


    socialData.extConfig.wechatTimelineData.title = _shareInfo.title;
    socialData.extConfig.wechatTimelineData.url = _shareInfo.url;

    //网络图片url的分享,如果有url图片,则本地图片shareImage无效了,可以设置nil;
    [[UMSocialData defaultData].urlResource setResourceType:UMSocialUrlResourceTypeImage url:_shareInfo.ico];

    [UMSocialSnsService presentSnsIconSheetView:self
    appKey:nil
    shareText:_shareInfo.content
    shareImage:nil
    shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToEmail,UMShareToQQ,UMShareToQzone,UMShareToWechatSession,UMShareToWechatTimeline,UMShareToSms,nil]
    delegate:nil];

    }

  • 相关阅读:
    AtCoder Grand Contest 49
    Kotlin Heroes 5: ICPC Round 题解 (A-H)
    轮盘赌随机选择算法
    洛谷P1579.验证哥德巴赫猜想(DFS+素性测试)
    洛谷P1308.统计单词数(字符串匹配)
    洛谷P1149.火柴棒等式(暴力搜索)
    洛谷P1036.选数(DFS)
    洛谷P1028.数的计算(动态规划)
    Python对list操作的一些小技巧
    图的DFS和BFS(邻接表)
  • 原文地址:https://www.cnblogs.com/showker/p/8324434.html
Copyright © 2011-2022 走看看