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

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

第三方分享(新浪,微信,QQ)
[WXApi registerApp:WEIXINAPPID];
    [WeiboSDK registerApp:WEIBOkey];
View Code

2.AppDelegate文件

第三方分享(新浪,微信,QQ)
-(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)

上一篇:微信头像的灵活使用


下一篇:微信开发时遇到底部遮挡输入框的解决方案