美文网首页
ios 友盟分享

ios 友盟分享

作者: oc123 | 来源:发表于2017-10-17 19:54 被阅读0次

    在集成友盟分享过程中,本人有时候偷懒,直接将友盟demo的初始代码、静态库一设,直接调用起调分享UI,出现如图现象:


    分享item丢失.jpg

    出现这个现象的原因就是没有配置SSO白名单!
    右键info.plist选择source code打开(plist具体设置在Build Setting -> Packaging -> Info.plist File可获取plist路径) 请根据选择的平台对以下配置进行缩减:

      <key>LSApplicationQueriesSchemes</key>
    <array>
        <!-- 微信 URL Scheme 白名单-->
        <string>wechat</string>
        <string>weixin</string>
    
        <!-- 新浪微博 URL Scheme 白名单-->
        <string>sinaweibohd</string>
        <string>sinaweibo</string>
        <string>sinaweibosso</string>
        <string>weibosdk</string>
        <string>weibosdk2.5</string>
    
        <!-- QQ、Qzone、TIM URL Scheme 白名单-->
        <string>mqqapi</string>
        <string>mqq</string>
        <string>mqqOpensdkSSoLogin</string>
        <string>mqqconnect</string>
        <string>mqqopensdkdataline</string>
        <string>mqqopensdkgrouptribeshare</string>
        <string>mqqopensdkfriend</string>
        <string>mqqopensdkapi</string>
        <string>mqqopensdkapiV2</string>
        <string>mqqopensdkapiV3</string>
        <string>mqqopensdkapiV4</string>
        <string>mqzoneopensdk</string>
        <string>wtloginmqq</string>
        <string>wtloginmqq2</string>
        <string>mqqwpa</string>
        <string>mqzone</string>
        <string>mqzonev2</string>
        <string>mqzoneshare</string>
        <string>wtloginqzone</string>
        <string>mqzonewx</string>
        <string>mqzoneopensdkapiV2</string>
        <string>mqzoneopensdkapi19</string>
        <string>mqzoneopensdkapi</string>
        <string>mqqbrowser</string>
        <string>mttbrowser</string>
        <string>tim</string>
        <string>timapi</string>
        <string>timopensdkfriend</string>
        <string>timwpa</string>
        <string>timgamebindinggroup</string>
        <string>timapiwallet</string>
        <string>timOpensdkSSoLogin</string>
        <string>wtlogintim</string>
        <string>timopensdkgrouptribeshare</string>
        <string>timopensdkapiV4</string>
        <string>timgamebindinggroup</string>
        <string>timopensdkdataline</string>
        <string>wtlogintimV1</string>
        <string>timapiV1</string>
    
        <!-- 支付宝 URL Scheme 白名单-->
        <string>alipay</string>
        <string>alipayshare</string>
    
        <!-- 钉钉 URL Scheme 白名单-->
          <string>dingtalk</string>
          <string>dingtalk-open</string>
    
        <!--Linkedin URL Scheme 白名单-->
        <string>linkedin</string>
        <string>linkedin-sdk2</string>
        <string>linkedin-sdk</string>
    
        <!-- 点点虫 URL Scheme 白名单-->
        <string>laiwangsso</string>
    
        <!-- 易信 URL Scheme 白名单-->
        <string>yixin</string>
        <string>yixinopenapi</string>
    
        <!-- instagram URL Scheme 白名单-->
        <string>instagram</string>
    
        <!-- whatsapp URL Scheme 白名单-->
        <string>whatsapp</string>
    
        <!-- line URL Scheme 白名单-->
        <string>line</string>
    
        <!-- Facebook URL Scheme 白名单-->
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    
        <!-- Kakao URL Scheme 白名单-->  
        <!-- 注:以下第一个参数需替换为自己的kakao appkey--> 
        <!-- 格式为 kakao + "kakao appkey"-->    
        <string>kakaofa63a0b2356e923f3edd6512d531f546</string>
        <string>kakaokompassauth</string>
        <string>storykompassauth</string>
        <string>kakaolink</string>
        <string>kakaotalk-4.5.0</string>
        <string>kakaostory-2.9.0</string>
    
       <!-- pinterest URL Scheme 白名单-->  
        <string>pinterestsdk.v1</string>
    
       <!-- Tumblr URL Scheme 白名单-->  
        <string>tumblr</string>
    
       <!-- 印象笔记 -->
        <string>evernote</string>
        <string>en</string>
        <string>enx</string>
        <string>evernotecid</string>
        <string>evernotemsg</string>
    
       <!-- 有道云笔记-->
        <string>youdaonote</string>
        <string>ynotedictfav</string>
        <string>com.youdao.note.todayViewNote</string>
        <string>ynotesharesdk</string>
    
       <!-- Google+-->
        <string>gplus</string>
    
       <!-- Pocket-->
        <string>pocket</string>
        <string>readitlater</string>
        <string>pocket-oauth-v1</string>
        <string>fb131450656879143</string>
        <string>en-readitlater-5776</string>
        <string>com.ideashower.ReadItLaterPro3</string>
        <string>com.ideashower.ReadItLaterPro</string>
        <string>com.ideashower.ReadItLaterProAlpha</string>
        <string>com.ideashower.ReadItLaterProEnterprise</string>
    
       <!-- VKontakte-->
        <string>vk</string>
        <string>vk-share</string>
        <string>vkauthorize</string>
    </array>
    
    

    分享环境配置略,这里提供分享所用文件和3个友盟库方便使用,直接拖入项目就行,链接:https://github.com/wangshuixin/UM3FrameWork
    调用分享UI代码:

      [UMShareCategory shareUMShare:@"分享测试" content:@"测试分享内容!测试分享内容!测试分享内容!" imageName:@"icon" jumpUrl:@"https://www.baidu.com" isPlatformTypeSms:NO];
    

    相关文章

      网友评论

          本文标题:ios 友盟分享

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