您的位置:首页 > 移动开发 > IOS开发

iOS ShareSDK的新浪微博配置

2015-09-28 17:29 429 查看
- (void)registerApp {
    [ShareSDK registerApp:@"4681c730737c" activePlatforms:@[@(SSDKPlatformTypeSinaWeibo), @(SSDKPlatformTypeQQ), @(SSDKPlatformTypeWechat)] onImport:^(SSDKPlatformType platformType) {
         switch (platformType)
         {
             case SSDKPlatformTypeWechat:
                 [ShareSDKConnector connectWeChat:[WXApi class]];
                 break;
             case SSDKPlatformTypeQQ:
                 [ShareSDKConnector connectQQ:[QQApiInterface class] tencentOAuthClass:[TencentOAuth class]];
                 break;
             case SSDKPlatformTypeSinaWeibo:
                 [ShareSDKConnector connectWeibo:[WeiboSDK class]];
                 break;
             default:
                 break;
         }
     } onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo) {
        
        switch (platformType) {
            case SSDKPlatformTypeSinaWeibo:
                [appInfo SSDKSetupSinaWeiboByAppKey:@"3121875182" appSecret:@"9f350766c81976724b9e7fb45f41234c" <span style="color:#ff6666;">redirectUri</span>:@"https://www.baidu.com/" authType:SSDKAuthTypeBoth];
                break;
                
            case SSDKPlatformTypeQQ:
                [appInfo SSDKSetupQQByAppId:@"1123427886" appKey:@"Zo93Onibde17ThtR" authType:SSDKAuthTypeBoth];
                break;
                
            case SSDKPlatformTypeWechat:
                [appInfo SSDKSetupWeChatByAppId:@"wx123456a30ff2061e" appSecret:@"1234a34086598531b1d80e2b92273d09"];
                break;
                
            default:
                break;
        }
    }];
}


在使用ShareSDK进行新浪微博的分享时出现了一个错误:error:redirect_uri_mismatch

这是redirectUri配置不正确导致的,这里需要做到三点一致,即微博平台配置、ShareSDK控制台配置、代码。





这样问题就解决了!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: