ios中分享的回调地址

- (BOOL)applicationUIApplication *)application openURLNSURL *)url sourceApplicationNSString *)sourceApplication annotationid)annotation
{
if ([url.absoluteString hasPrefix"tencent"]) {
[QQApiInterface handleOpenURL:url delegate:self]];
return YES;
}
-(void) onRespQQBaseResp*)resp
{

}
问题描述:用qq和微信官方SDK做好友分享,微信可以回调返回分享结果,但是qq不行。官方文档也没说什么实质性的内容,代码如下,各位帮忙找找错。
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
    
    if ([url.scheme isEqualToString:@"wxd930ea5d5a258f4f"]) {
        return [WXApi handleOpenURL:url delegate:self];
    }else if ([url.scheme isEqualToString:[NSString stringWithFormat:@"tencent%s","222222"]]) {
        return [TencentOAuth HandleOpenURL:url];
    }else {
        return YES;
    }
}

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{
    if ([url.scheme isEqualToString:@"wxd930ea5d5a258f4f"]) {
        return [WXApi handleOpenURL:url delegate:self];
    }else if ([url.scheme isEqualToString:[NSString stringWithFormat:@"tencent%s","222222"]]) {
        [QQApiInterface handleOpenURL:url delegate:self];
    }else {
        return YES;
    }
    //return [TencentOAuth HandleOpenUrl:url];
}

-(void)onResp:(id)resp
{
    if ([resp isKindOfClass:[SendMessageToWXResp class]])
    {
        SendMessageToWXResp *WxResp = (SendMessageToWXResp *)resp;
        
        NSString *str ;//= [NSString stringWithFormat:@"%d",resp.errCode];
        if(WxResp.errCode==0)
        {
            str=@"分享成功!";
        }
        else{
            str=@"分享失败!";
        }
        UIAlertView *shareresultalertview = [[UIAlertView alloc] initWithTitle:@"结果反馈" message:str delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [shareresultalertview show];
        [shareresultalertview release];
    }
    if ([resp isKindOfClass:[SendMessageToQQResp class]]) {
       
                SendMessageToQQResp * QQResp = (SendMessageToQQResp *)resp;
                if (QQResp.type==ESENDMESSAGETOQQRESPTYPE&&[QQResp.result integerValue]==0)
                {
                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"成功" message:@"QQ分享成功" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                    [alert show];
                    [alert release];
                }
                else
                {
                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"失败" message:@"QQ分享失败" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                    [alert show];
                    [alert release];
                }
        
    }


级别: 新手上路
UID:  335231
精华:  0 
发帖:  68
可可豆:  77 CB
威望:  80 点
在线时间:  252(时)
注册时间:  2014-06-29
最后登录:  2017-09-27
1 楼:  发表于: 2017-02-27 10:17    发自: Web Page
只看该作者        
if ([url.scheme isEqualToString:[NSString stringWithFormat:@"tencent%s","222222"]]) {
        return [TencentOAuth HandleOpenURL:url];
    }
你QQ的appid是"222222"么 
 
 
 
 
 
 
 

                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值