Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
GMShareSDK
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMShareSDK
Commits
8719ca28
Commit
8719ca28
authored
Mar 19, 2020
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信支持调试
parent
262f2fdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
GMThirdPartyDefine.h
GMShareSDK/Classes/ShareSDK/GMThirdPartyDefine.h
+2
-0
GMThirdPartyOauthManager.h
GMShareSDK/Classes/ShareSDK/GMThirdPartyOauthManager.h
+6
-2
GMThirdPartyOauthManager.m
GMShareSDK/Classes/ShareSDK/GMThirdPartyOauthManager.m
+18
-12
No files found.
GMShareSDK/Classes/ShareSDK/GMThirdPartyDefine.h
View file @
8719ca28
...
...
@@ -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"
...
...
GMShareSDK/Classes/ShareSDK/GMThirdPartyOauthManager.h
View file @
8719ca28
...
...
@@ -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
;
...
...
GMShareSDK/Classes/ShareSDK/GMThirdPartyOauthManager.m
View file @
8719ca28
...
...
@@ -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
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment