Commit 8719ca28 authored by 汪洋's avatar 汪洋

微信支持调试

parent 262f2fdd
......@@ -104,6 +104,8 @@ typedef NS_ENUM(NSUInteger, GMShareContentType){
#define kQQLogin @"kQQLogin"
#define kSinaLogin @"kSinaLogin"
#define kWechatLogin @"kWechatLogin"
#define kWechatPaySuccess @"kWechatPaySuccess"
#define kWechatPayFail @"kWechatPayFail"
//QQ好友和朋友圈会掉的url完全一样,所以没必要区分 QQ41A1DB6D://response_from_qq?source=qq&source_scheme=mqqapi&error=0&version=1&sdkv=3.1
#define kQQShare @"kQQShare"
......
......@@ -8,10 +8,14 @@
#import <Foundation/Foundation.h>
#import "GMThirdPartyLoginHelper.h"
#import <TencentOpenAPI/TencentOAuth.h>
#import <TencentOpenAPI/QQApiInterface.h>
#import <WechatOpenSDK/WXApi.h>
#import <WeiboSDK/WeiboSDK.h>
#import <DouyinOpenSDK/DouyinOpenSDKApi.h>
//这里是接受三方授权的回调
@class TencentOAuth;
@interface GMThirdPartyOauthManager : NSObject
@interface GMThirdPartyOauthManager : NSObject <TencentSessionDelegate, QQApiInterfaceDelegate, WXApiDelegate, WeiboSDKDelegate, DouyinOpenSDKApiDelegate>
@property (nonatomic, strong) GMThirdPartyUser * user;
@property (nonatomic, assign) GMSharePlatform currentShareType;
@property (strong, nonatomic) NSString *wbtoken;
......
......@@ -10,12 +10,10 @@
#import "GMThirdPartyLoginHelper.h"
#import "GMShareSDK.h"
#import <GMFoundation/NSString+GM.h>
#import <TencentOpenAPI/TencentOAuth.h>
#import "DouyinOpenSDKApi.h"
#import <WeiboSDK/WeiboSDK.h>
#import <WechatOpenSDK/WXApi.h>
@interface GMThirdPartyOauthManager()<WeiboSDKDelegate, WBHttpRequestDelegate, TencentSessionDelegate, WXApiDelegate, DouyinOpenSDKApiDelegate, DouyinOpenSDKLogDelegate>
@interface GMThirdPartyOauthManager()<WBHttpRequestDelegate, DouyinOpenSDKLogDelegate>
@end
@implementation GMThirdPartyOauthManager
......@@ -52,7 +50,7 @@
}
}
#pragma mark -- WeiboSDKDelegate
#pragma mark - WeiboSDKDelegate
- (void)didReceiveWeiboRequest:(WBBaseRequest *)request{}
......@@ -145,7 +143,7 @@
}
#pragma mark -- TencentSessionDelegate
#pragma mark - TencentSessionDelegate
- (void)tencentDidLogin {
if (![self.tencentOAuth.accessToken isNonEmpty]){
......@@ -192,12 +190,20 @@
}
# pragma mark -- WXApiDelegate
# pragma mark - WXApiDelegate
- (void)onResp:(BaseResp *)resp {
if([resp isKindOfClass:[SendAuthResp class]]){
// 微信请求App提供内容, 需要app提供内容后使用sendRsp返回
if([resp isKindOfClass:[PayResp class]]){
//支付返回结果,实际支付结果需要去微信服务器端查询
switch (resp.errCode) {
case WXSuccess:
[[NSNotificationCenter defaultCenter] postNotificationName:kWechatPaySuccess object:nil];
break;
default:
[[NSNotificationCenter defaultCenter] postNotificationName:kWechatPayFail object:nil];
break;
}
}else if([resp isKindOfClass:[SendAuthResp class]]){
// 微信请求App提供内容,需要app提供内容后使用sendRsp返回
SendAuthResp *authResp = (SendAuthResp *)resp;
if (resp.errCode == 0) {
[self requestWechatAccessTokenWithCode:authResp.code];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment