码迷,mamicode.com
首页 > 微信 > 详细

第三方分享(新浪,微信,QQ)

时间:2015-09-22 16:05:02      阅读:337      评论:0      收藏:0      [点我收藏+]

标签:

1.去各个平台下载ShareSDK,并注册

技术分享
[WXApi registerApp:WEIXINAPPID];
    [WeiboSDK registerApp:WEIBOkey];
View Code

2.AppDelegate文件

技术分享
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    if ([url.scheme isEqualToString:WEIXINAPPID])
    {
        if (_weixinshare==nil) {
            _weixinshare=[[WeiXinShare alloc]init];
        }
      return [WXApi handleOpenURL:url delegate:_weixinshare];
    }
    else if ([url.scheme isEqualToString:@"wb1566451595"])
    {
        if (_sinaweiboshare==nil) {
            _sinaweiboshare=[[SinaWeiboShare alloc]init];
        }

        return [WeiboSDK handleOpenURL:url delegate:_sinaweiboshare];
    }
    else if ([url.scheme isEqualToString:@"tencent100794309"])
    {
        if (_tencenqqshare==nil) {
            _tencenqqshare=[[TencenQQshare alloc]init];
        }
        return [QQApiInterface handleOpenURL:url delegate:_tencenqqshare];
    }
    return YES;
}
View Code

 

第三方分享(新浪,微信,QQ)

标签:

原文地址:http://www.cnblogs.com/liaods/p/4828877.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!