您的位置:首页 > 其它

友盟分享

2015-12-21 16:27 302 查看
第一部  导入



这两个文件导入成功后

在info.plist 导入每一个key

 <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>log.umsns.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
            <key>sns.whalecloud.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
            
            <!-- 集成新浪微博对应的HTTP白名单-->
            <key>sina.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>weibo.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>weibo.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>sinaimg.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>sinajs.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>sina.com.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <k
107cc
ey>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <!-- 新浪微博-->
            
            <!-- 集成微信、QQ、Qzone、腾讯微博授权对应的HTTP白名单-->
            <key>qq.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <!-- 腾讯授权-->
            
            <!-- 集成人人授权对应的HTTP白名单-->
            <key>renren.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <!-- 人人授权-->
            
            <!-- 集成Facebook授权对应的HTTP白名单-->
            <key>facebook.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>fbcdn.net</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>akamaihd.net</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <!-- Facebook授权-->
            
            <!-- 集成Twitter授权对应的HTTP白名单-->
            <key>twitter.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>                
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <!-- Twitter授权-->
        </dict>
    </dict>
    <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 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>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>
        
        <!-- 支付宝 URL Scheme
白名单-->
        <string>alipay</string>
        <string>alipayshare</string>
        
        <!-- 人人 URL Scheme
白名单-->
        <string>renrenios</string>
        <string>renrenapi</string>
        <string>renren</string>
        <string>renreniphone</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>
        
        <!-- Tumblr URL Scheme
白名单-->
        <string>tumblr</string>
        
        <!-- Facebook URL Scheme
白名单-->
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>


2.导入框架



所有  支付  分享的框架 

代码实现

appdelegate

#define UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#import "UMSocial.h"//导入友盟

//#import "MobClick.h"//统计 
不需要用
//以下用哪一个导入哪一个
#import "UMSocialYixinHandler.h"
#import "UMSocialFacebookHandler.h"
//#import "UMSocialLaiwangHandler.h"
#import "UMSocialWechatHandler.h"
#import "UMSocialTwitterHandler.h"
#import "UMSocialQQHandler.h"
//#import "UMSocialSinaHandler.h"
#import "UMSocialSinaSSOHandler.h"
//#import "UMSocialTencentWeiboHandler.h"
#import "UMSocialRenrenHandler.h"

#import "UMSocialInstagramHandler.h"
#import "UMSocialWhatsappHandler.h"
#import "UMSocialLineHandler.h"
#import "UMSocialTumblrHandler.h"
#import "UMSocialAlipayShareHandler.h"

3最后就是使用
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: