ShareSDK更新到4.2.3

2019-03-18  本文已影响0人  hehc08

一.Pod相关

原来的
  pod 'ShareSDK3'
  pod 'MOBFoundation'
  pod 'ShareSDK3/ShareSDKPlatforms/QQ'
  pod 'ShareSDK3/ShareSDKPlatforms/SinaWeibo'

修改成:

  pod 'mob_sharesdk'
  pod 'mob_sharesdk/ShareSDKUI'
  pod 'mob_sharesdk/ShareSDKExtension'
  pod 'mob_sharesdk/ShareSDKPlatforms/QQ'
  pod 'mob_sharesdk/ShareSDKPlatforms/SinaWeibo'
  pod 'mob_sharesdk/ShareSDKPlatforms/WeChat'

执行

pod install

二 .修改ShareSDKHandler.m文件

//删除
#import <ShareSDKConnector/ShareSDKConnector.h>
#import <ShareSDK3/WeiboSDK.h>
#import <WechatOpenSDK/WXApi.h>
#import <ShareSDK3/TencentOpenAPI/TencentOAuth.h>
#import <ShareSDK3/TencentOpenAPI/QQApiInterface.h>
//增加
#import <ShareSDK/ShareSDK.h>
#import <ShareSDK/ShareSDK+Base.h>
    [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) {
        //QQ
        [platformsRegister setupQQWithAppId:qqAppID appkey:qqAppKey];
        //微信
        [platformsRegister setupWeChatWithAppId:wechatAppID appSecret:wechatAppSecret];
        //新浪
        [platformsRegister setupSinaWeiboWithAppkey:weiboAppKey appSecret:weiboAppSecret redirectUrl:weiboRedirectURL];
    }];
[ShareSDK cancelAuthorize:platformType];

修改成

[ShareSDK cancelAuthorize:platformType result:^(NSError *error) {
    NSLog(@"cancelAuthorize error:%@",error.localizedDescription);
}];

 [parameters SSDKSetupWeChatParamsByText:text title:title url:URL thumbImage:thumbImage image:image musicFileURL:mediaURL extInfo:nil fileData:nil emoticonData:nil type:contentType forPlatformSubType:platformType];

修改成

 [parameters SSDKSetupWeChatParamsByText:text title:title url:URL thumbImage:thumbImage image:image musicFileURL:mediaURL extInfo:nil fileData:nil emoticonData:nil sourceFileExtension:nil sourceFileData:nil type:contentType forPlatformSubType:platformType];

上一篇下一篇

猜你喜欢

热点阅读