使用ShareSDK将信息分享到qq空间出现错误
2013-02-22 11:57:15.722 ProjectName[4308:19d03] 分享失败,错误码:100031,错误描述:app has no privilege to use this api
调用的函数是
//shareContentWithShareList 直接将信息分享道qq空间中
[ShareSDK shareContentWithShareList:[ShareSDK getShareListWithType:ShareTypeQQSpace,nil]
content:[ShareSDK publishContent:CONTENT
defaultContent:@""
image:[UIImage imageNamed:@"closeSel.png"] //分享的图片资源
imageQuality:0.8
mediaType:SSPublishContentMediaTypeNews
title:@"ShareSDK"
url:@"http://www.sharesdk.cn"
musicFileUrl:nil
extInfo:nil
fileData:nil]
statusBarTips:YES
result:^(ShareType type, SSPublishContentState state, id<ISSStatusInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {
if (state == SSPublishContentStateSuccess)
{
NSLog(@"分享成功");
}
else if (state == SSPublishContentStateFail)
{
NSLog(@"分享失败,错误码:%d,错误描述:%@", [error errorCode], [error errorDescription]);//最后程序在这里出现:分享失败,错误码:100031,错误描述:app has no privilege to use this api
}
}];
#pragma mark - QQ空间应用配置信息qq空间分享失败
//http://connect.qq.com/intro/login/上申请加入QQ登录,并将相关信息填写到以下字段
// NSString *ssQqSpaceAppKey = @"100371282";
// NSString *ssQqSpaceAppSecret = @"aed9b0303e3ed1e27bae87c33761161d";
NSString *ssQqSpaceAppKey = @"100380964";
NSString *ssQqSpaceAppSecret = @"691532a5aae835e84ea67010e6bdfbb2";