- (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];
}
}
}
关键词: qq微信好友分享
ios中分享的回调地址
最新推荐文章于 2023-01-09 08:59:09 发布
- (BOOL)applicationUIApplication *)application openURLNSURL *)url sourceApplicationNSString *)sourceApplication annotationid)annotation
{
if ([url.absoluteString hasPrefix"tencent"]) {
[QQApiInterface handleOpenURL:url delegate:self]];
return YES;
}
-(void) onRespQQBaseResp*)resp
{
}