帮助与文档

> >

由于Appkey的注册方式修改,新版 Appkey 统一在info.plist中设置,需要如下操作:

在项目工程的Info.plist 中如图增加 MOBAppKeyMOBAppSecret 两个字段
在 MOBAppKey中 设置 ShareSDK的appKey,如果尚未在ShareSDK官网注册过App,请移步到登录后台进行应用注册  也可以点击链接看里面的操作步骤。
appkey
由于现在统一在info.plist中设置appkey 所以新版本 ShareSDK 注册方法中去除了appkey设置功能
另: 如果您使用的是配置xml方式注册ShareSDK的只需要完成Info.plist中 MOBAppkeyMOBAppSecret 的新增和设置就可以
3.6.4以前的3.0版本ShareSDK注册方法 3.6.4新版本注册方法
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[ShareSDK registerApp:@”iosv1101″
           activePlatforms:@[
                            @(SSDKPlatformTypeSinaWeibo),
                            @(SSDKPlatformTypeMail),
                            @(SSDKPlatformTypeSMS),
                            @(SSDKPlatformTypeCopy),
                            @(SSDKPlatformTypeWechat),
                            @(SSDKPlatformTypeQQ),
                            @(SSDKPlatformTypeRenren),
                            @(SSDKPlatformTypeGooglePlus)]
           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;
                  case SSDKPlatformTypeRenren:
                          [ShareSDKConnector connectRenren:[RennClient class]];
                    break;
                  default:
                    break;
                }
          }
          onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo)
          {
              switch (platformType)
              {
                  case SSDKPlatformTypeSinaWeibo:
                      //设置新浪微博应用信息,其中authType设置为使用SSO+Web形式授权
                      [appInfo SSDKSetupSinaWeiboByAppKey:@”568898243″
                                                appSecret:@”38a4f8204cc784f81f9f0daaf31e02e3″
                                              redirectUri:@”http://www.sharesdk.cn
                                                 authType:SSDKAuthTypeBoth];
                   break;
                  case SSDKPlatformTypeWechat:
                      [appInfo SSDKSetupWeChatByAppId:@”wx4868b35061f87885″
                                            appSecret:@”64020361b8ec4c99936c0e3999a9f249″];
                   break;
                  case SSDKPlatformTypeQQ:
                      [appInfo SSDKSetupQQByAppId:@”100371282″
                                           appKey:@”aed9b0303e3ed1e27bae87c33761161d”
                                         authType:SSDKAuthTypeBoth];
                   break;
                  case SSDKPlatformTypeRenren:
                      [appInfo        SSDKSetupRenRenByAppId:@”226427″
                                               appKey:@”fc5b8aed373c4c27a05b712acba0f8c3″
                                            secretKey:@”f29df781abdd4f49beca5a2194676ca4″
                                             authType:SSDKAuthTypeBoth];
                    break;
                   case SSDKPlatformTypeGooglePlus:
                     [appInfo SSDKSetupGooglePlusByClientID:@”232554794995.apps.googleusercontent.com
                                                clientSecret:@”PEdFgtrMw97aCvf0joQj7EMk”
                                                 redirectUri:@”http://localhost“];
                    break;
                   default:
                    break;
              }
          }];
return YES;
}
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//新版本注册方法不在需要进行 appkey的注册
[ShareSDK registerActivePlatforms:@[
                            @(SSDKPlatformTypeSinaWeibo),
                            @(SSDKPlatformTypeMail),
                            @(SSDKPlatformTypeSMS),
                            @(SSDKPlatformTypeCopy),
                            @(SSDKPlatformTypeWechat),
                            @(SSDKPlatformTypeQQ),
                            @(SSDKPlatformTypeRenren),
                            @(SSDKPlatformTypeGooglePlus)]
           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;
                  case SSDKPlatformTypeRenren:
                          [ShareSDKConnector connectRenren:[RennClient class]];
                    break;
                  default:
                    break;
                }
          }
          onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo)
          {
              switch (platformType)
              {
                  case SSDKPlatformTypeSinaWeibo:
                      //设置新浪微博应用信息,其中authType设置为使用SSO+Web形式授权
                      [appInfo SSDKSetupSinaWeiboByAppKey:@”568898243″
                                                appSecret:@”38a4f8204cc784f81f9f0daaf31e02e3″
                                              redirectUri:@”http://www.sharesdk.cn
                                                 authType:SSDKAuthTypeBoth];
                   break;
                  case SSDKPlatformTypeWechat:
                      [appInfo SSDKSetupWeChatByAppId:@”wx4868b35061f87885″
                                            appSecret:@”64020361b8ec4c99936c0e3999a9f249″];
                   break;
                  case SSDKPlatformTypeQQ:
                      [appInfo SSDKSetupQQByAppId:@”100371282″
                                           appKey:@”aed9b0303e3ed1e27bae87c33761161d”
                                         authType:SSDKAuthTypeBoth];
                   break;
                  case SSDKPlatformTypeRenren:
                      [appInfo        SSDKSetupRenRenByAppId:@”226427″
                                               appKey:@”fc5b8aed373c4c27a05b712acba0f8c3″
                                            secretKey:@”f29df781abdd4f49beca5a2194676ca4″
                                             authType:SSDKAuthTypeBoth];
                    break;
                   case SSDKPlatformTypeGooglePlus:
                     [appInfo SSDKSetupGooglePlusByClientID:@”232554794995.apps.googleusercontent.com
                                                clientSecret:@”PEdFgtrMw97aCvf0joQj7EMk”
                                                 redirectUri:@”http://localhost“];
                    break;
                   default:
                    break;
              }
          }];
return YES;
}

 

集成时使用的是mob官网下载的ShareSDK版本(非cocopods集成)
由于新SDK目录结构变化 需要进行以下操作
1.在XCode工程目录下删除原来的ShareSDK目录
2.拖入新下载的SDK文件夹中的SDK目录
旧版 工程目录 3.6.4新版工程目录
旧版目录 新版目录
0 0