com.xd.sdk.account 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +20 -0
  2. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +7 -0
  3. package/Mobile/Editor/XDAccountMobileProcessBuild.cs +20 -0
  4. package/Mobile/Editor/XDAccountMobileProcessBuild.cs.meta +11 -0
  5. package/Mobile/Editor.meta +8 -0
  6. package/Mobile/Http/XDGAccountHttpConfigMobile.cs +36 -0
  7. package/Mobile/Http/XDGAccountHttpConfigMobile.cs.meta +11 -0
  8. package/Mobile/Http.meta +8 -0
  9. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +15 -0
  10. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta +32 -0
  11. package/Mobile/Plugins/Android/com/xd/account/bridge.meta +8 -0
  12. package/Mobile/Plugins/Android/com/xd/account.meta +8 -0
  13. package/Mobile/Plugins/Android/com/xd.meta +8 -0
  14. package/Mobile/Plugins/Android/com.meta +8 -0
  15. package/Mobile/Plugins/Android.meta +8 -0
  16. package/Mobile/Plugins/iOS/XDAccountBridge.m +26 -0
  17. package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +37 -0
  18. package/Mobile/Plugins/iOS.meta +8 -0
  19. package/Mobile/Plugins.meta +8 -0
  20. package/Mobile/User/UserManagerMobile.cs +45 -0
  21. package/Mobile/User/UserManagerMobile.cs.meta +3 -0
  22. package/Mobile/User.meta +3 -0
  23. package/Mobile/XD.SDK.Account.Mobile.asmdef +23 -0
  24. package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +7 -0
  25. package/Mobile/XDGAccountMobile.cs +132 -0
  26. package/Mobile/XDGAccountMobile.cs.meta +11 -0
  27. package/Mobile/XDGAccountMobileImpl.cs +421 -0
  28. package/Mobile/XDGAccountMobileImpl.cs.meta +11 -0
  29. package/Mobile/XDGTokenManager.cs +116 -0
  30. package/Mobile/XDGTokenManager.cs.meta +3 -0
  31. package/Mobile/XDGUserWrapper.cs +167 -0
  32. package/Mobile/XDGUserWrapper.cs.meta +11 -0
  33. package/Mobile.meta +8 -0
  34. package/Plugins/Android/libs/XDGAccount_6.21.1.aar +0 -0
  35. package/Plugins/Android/libs/XDGAccount_6.21.1.aar.meta +32 -0
  36. package/Plugins/Android/libs.meta +8 -0
  37. package/Plugins/Android.meta +8 -0
  38. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +61 -0
  39. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +7 -0
  40. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +47 -0
  41. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h.meta +7 -0
  42. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +24 -0
  43. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +7 -0
  44. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +69 -0
  45. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +7 -0
  46. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +8 -0
  47. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +7 -0
  48. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +21 -0
  49. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +7 -0
  50. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h +16 -0
  51. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +7 -0
  52. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h +47 -0
  53. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +7 -0
  54. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +33 -0
  55. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h.meta +7 -0
  56. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h +23 -0
  57. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +7 -0
  58. package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +8 -0
  59. package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
  60. package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +7 -0
  61. package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap +6 -0
  62. package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +7 -0
  63. package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +8 -0
  64. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
  65. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +7 -0
  66. package/Plugins/iOS/XDAccountSDK.framework.meta +28 -0
  67. package/Plugins/iOS.meta +8 -0
  68. package/Plugins.meta +8 -0
  69. package/README.md +0 -0
  70. package/README.md.meta +7 -0
  71. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +19 -0
  72. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +7 -0
  73. package/Runtime/Editor/XDAccountProcessBuild.cs +18 -0
  74. package/Runtime/Editor/XDAccountProcessBuild.cs.meta +11 -0
  75. package/Runtime/Editor.meta +8 -0
  76. package/Runtime/IXDGAccount.cs +42 -0
  77. package/Runtime/IXDGAccount.cs.meta +3 -0
  78. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +9 -0
  79. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +11 -0
  80. package/Runtime/Internal/Http/XDAccountHttpConfig.cs +32 -0
  81. package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +11 -0
  82. package/Runtime/Internal/Http.meta +8 -0
  83. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +7 -0
  84. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +3 -0
  85. package/Runtime/Internal/User.meta +3 -0
  86. package/Runtime/Internal.meta +8 -0
  87. package/Runtime/UserManager.cs +35 -0
  88. package/Runtime/UserManager.cs.meta +3 -0
  89. package/Runtime/XD.SDK.Account.asmdef +16 -0
  90. package/Runtime/XD.SDK.Account.asmdef.meta +7 -0
  91. package/Runtime/XDGAccessToken.cs +18 -0
  92. package/Runtime/XDGAccessToken.cs.meta +3 -0
  93. package/Runtime/XDGAccount.cs +123 -0
  94. package/Runtime/XDGAccount.cs.meta +3 -0
  95. package/Runtime/XDGLoginType.cs +28 -0
  96. package/Runtime/XDGLoginType.cs.meta +3 -0
  97. package/Runtime/XDGUser.cs +30 -0
  98. package/Runtime/XDGUser.cs.meta +3 -0
  99. package/Runtime/XDGUserStatusCode.cs +16 -0
  100. package/Runtime/XDGUserStatusCode.cs.meta +3 -0
  101. package/Runtime.meta +3 -0
  102. package/package.json +11 -0
  103. package/package.json.meta +7 -0
@@ -0,0 +1,167 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using TapTap.Common;
4
+ using UnityEngine;
5
+ using System.Collections;
6
+ using System.Linq;
7
+ using XD.SDK.Account;
8
+ using XD.SDK.Account;
9
+ using XD.SDK.Common;
10
+
11
+ namespace XD.SDK.Account
12
+ {
13
+ // The user's bound accounts. eg.@[@"TAPTAP",@"GOOGLE",@"FACEBOOK"]
14
+ [Serializable]
15
+ public class XDGUserMobile : XDGUser
16
+ {
17
+ // The user's user ID.
18
+ public string _userId;
19
+
20
+ // The user’s user ID in string.
21
+ public string _sub;
22
+
23
+ // The user's user name.
24
+ public string _name;
25
+
26
+ // The user's current loginType.
27
+ public string _loginType; //App传来的是字符串,如 TapTap。 通过 GetLoginType() 方法获取枚举
28
+
29
+ public string _avatar;
30
+
31
+ public string _nickName;
32
+
33
+ public List<string> _boundAccounts;
34
+
35
+ // The user's token.
36
+ public XDGAccessToken _token;
37
+
38
+ public XDGUserMobile(string json)
39
+ {
40
+ Dictionary<string, object> dic = Json.Deserialize(json) as Dictionary<string, object>;
41
+ this._userId = SafeDictionary.GetValue<string>(dic, "userId");
42
+ this._sub = SafeDictionary.GetValue<string>(dic, "sub");
43
+ this._name = SafeDictionary.GetValue<string>(dic, "name");
44
+ this._loginType = SafeDictionary.GetValue<string>(dic, "loginType");
45
+ this._avatar = SafeDictionary.GetValue<string>(dic, "avatar");
46
+ this._nickName = SafeDictionary.GetValue<string>(dic, "nickName");
47
+ this._boundAccounts = SafeDictionary.GetValue<List<object>>(dic, "boundAccounts")?.Cast<string>().ToList();
48
+ this._token = new XDGAccessTokenMobile(SafeDictionary.GetValue<Dictionary<string, object>>(dic, "token"));
49
+ }
50
+
51
+ public XDGUserMobile(Dictionary<string, object> dic)
52
+ {
53
+ this._userId = SafeDictionary.GetValue<string>(dic, "userId");
54
+ this._sub = SafeDictionary.GetValue<string>(dic, "sub");
55
+ this._name = SafeDictionary.GetValue<string>(dic, "name");
56
+ this._loginType = SafeDictionary.GetValue<string>(dic, "loginType");
57
+ this._avatar = SafeDictionary.GetValue<string>(dic, "avatar");
58
+ this._nickName = SafeDictionary.GetValue<string>(dic, "nickName");
59
+ this._boundAccounts = SafeDictionary.GetValue<List<object>>(dic, "boundAccounts")?.Cast<string>().ToList();
60
+ this._token = new XDGAccessTokenMobile(SafeDictionary.GetValue<Dictionary<string, object>>(dic, "token"));
61
+
62
+ XDGLogger.Debug($"打印UserId: {_userId}");
63
+ }
64
+
65
+ public XD.SDK.Account.LoginType GetLoginType()
66
+ {
67
+ var strType = this._loginType.ToLower();
68
+ switch (strType)
69
+ {
70
+ case "taptap":
71
+ return XD.SDK.Account.LoginType.TapTap;
72
+ case "google":
73
+ return XD.SDK.Account.LoginType.Google;
74
+ case "facebook":
75
+ return XD.SDK.Account.LoginType.Facebook;
76
+ case "apple":
77
+ return XD.SDK.Account.LoginType.Apple;
78
+ case "line":
79
+ return XD.SDK.Account.LoginType.LINE;
80
+ case "twitter":
81
+ return XD.SDK.Account.LoginType.Twitter;
82
+ // case "qq":
83
+ // return XD.SDK.Account.LoginType.QQ;
84
+ // case "twitch":
85
+ // return XD.SDK.Account.LoginType.Twitch;
86
+ case "steam":
87
+ return XD.SDK.Account.LoginType.Steam;
88
+ case "guest":
89
+ return XD.SDK.Account.LoginType.Guest;
90
+ case "phone":
91
+ return XD.SDK.Account.LoginType.Phone;
92
+ }
93
+
94
+ return XD.SDK.Account.LoginType.Default;
95
+ }
96
+
97
+ public string userId => _userId;
98
+ public string name => _name;
99
+ public string sub => _sub;
100
+ public string loginType => XDGAccount.GetLoginTypeString(getLoginType());
101
+ public string avatar => _avatar;
102
+ public string nickName => _nickName;
103
+ public List<string> boundAccounts => _boundAccounts;
104
+ public XDGAccessToken token => _token;
105
+ public LoginType getLoginType()
106
+ {
107
+ return (LoginType)GetLoginType();
108
+ }
109
+ }
110
+
111
+ [Serializable]
112
+ public class XDGUserWrapper
113
+ {
114
+ public XDGUser user;
115
+ public XDGError error;
116
+
117
+ public XDGUserWrapper(string json)
118
+ {
119
+ Dictionary<string, object> contentDic = Json.Deserialize(json) as Dictionary<string, object>;
120
+ Dictionary<string, object>
121
+ userDic = SafeDictionary.GetValue<Dictionary<string, object>>(contentDic, "user");
122
+ Dictionary<string, object> errorDic =
123
+ SafeDictionary.GetValue<Dictionary<string, object>>(contentDic, "error");
124
+
125
+ if (userDic != null)
126
+ {
127
+ this.user = new XDGUserMobile(userDic);
128
+ }
129
+
130
+ if (errorDic != null)
131
+ {
132
+ this.error = new XDGErrorMobile(errorDic);
133
+ }
134
+ }
135
+ }
136
+
137
+ [Serializable]
138
+ public class XDGAccessTokenMobile : XDGAccessToken
139
+ {
140
+ // 唯一标志
141
+ private string _kid;
142
+
143
+ // 认证码类型
144
+ private string _tokenType;
145
+
146
+ // mac密钥
147
+ private string _macKey;
148
+
149
+ // mac密钥计算方式
150
+ private string _macAlgorithm;
151
+
152
+ public XDGAccessTokenMobile(Dictionary<string, object> dic)
153
+ {
154
+ if (dic == null) return;
155
+ this._kid = SafeDictionary.GetValue<string>(dic, "kid");
156
+ this._tokenType = SafeDictionary.GetValue<string>(dic, "tokenType");
157
+ this._macKey = SafeDictionary.GetValue<string>(dic, "macKey");
158
+ this._macAlgorithm = SafeDictionary.GetValue<string>(dic, "macAlgorithm");
159
+ }
160
+
161
+ public string kid => _kid;
162
+ public string tokenType => _tokenType;
163
+ public string macKey => _macKey;
164
+ public string macAlgorithm => _macAlgorithm;
165
+ }
166
+
167
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 66bb689890f974127a5824ad3dc5924f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Mobile.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: a6ccd9a263baa4cb2ba13d6dd4970353
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,32 @@
1
+ fileFormatVersion: 2
2
+ guid: 20715a95189b640a2b9c36186bffb4b0
3
+ PluginImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ iconMap: {}
7
+ executionOrder: {}
8
+ defineConstraints: []
9
+ isPreloaded: 0
10
+ isOverridable: 0
11
+ isExplicitlyReferenced: 0
12
+ validateReferences: 1
13
+ platformData:
14
+ - first:
15
+ Android: Android
16
+ second:
17
+ enabled: 1
18
+ settings: {}
19
+ - first:
20
+ Any:
21
+ second:
22
+ enabled: 0
23
+ settings: {}
24
+ - first:
25
+ Editor: Editor
26
+ second:
27
+ enabled: 0
28
+ settings:
29
+ DefaultValueInitialized: true
30
+ userData:
31
+ assetBundleName:
32
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 4d0ec27cc3eb7411cb336466974f93a0
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 0c4c7c038b00649f4a00573276914e57
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,61 @@
1
+ //
2
+ // TDSGlobalThirdPartyLoginHelper.h
3
+ // XDGAccountSDK
4
+ //
5
+ // Created by JiangJiahao on 2021/3/4.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <UIKit/UIKit.h>
10
+ #import <XDCommonSDK/XDGEntryType.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ typedef void(^TDSGlobalAuthSuccessCalback)(LoginEntryType authType,NSDictionary *result);
15
+ typedef void(^TDSGlobalAuthCancelCallback)(void);
16
+ typedef void(^TDSGlobalAuthWatingCallback)(void);
17
+ typedef void(^TDSGlobalAuthErrorCallback)(NSError *_Nullable error);
18
+
19
+ typedef NS_ENUM(NSInteger,TDSGlobalAuthErrorCode) {
20
+ TDSGlobalAuthErrorCodeNormalFail = 0x3001, // fail
21
+ TDSGlobalAuthErrorCodeNetworkOffline = 0x3002, // no network
22
+ TDSGlobalAuthErrorCodeUserCancel = 0x3003, // cancel
23
+ TDSGlobalAuthErrorCodeNotSupport = 0x3004, // not support
24
+
25
+ };
26
+
27
+ // 后台登录方式枚举
28
+ typedef NS_ENUM(NSInteger,XDGLoginInfoType) {
29
+ XDGLoginInfoTypeGuest = 0,
30
+ XDGLoginInfoTypeWeChat,
31
+ XDGLoginInfoTypeApple,
32
+ XDGLoginInfoTypeGoogle,
33
+ XDGLoginInfoTypeFacebook,
34
+ XDGLoginInfoTypeTapTap,
35
+ XDGLoginInfoTypeLine,
36
+ XDGLoginInfoTypeTwitter,
37
+ XDGLoginInfoTypeQQ,
38
+ XDGLoginInfoTypeTwitch,
39
+ XDGLoginInfoTypeSteam,
40
+ XDGLoginInfoTypePhone
41
+ };
42
+
43
+ @interface TDSGlobalThirdPartyLoginHelper : NSObject
44
+
45
+ + (void)authByType:(LoginEntryType)authType
46
+ fromViewController:(nullable UIViewController *)viewController
47
+ successCallback:(TDSGlobalAuthSuccessCalback)successCallback
48
+ cancelCallback:(TDSGlobalAuthCancelCallback)cancelCallback
49
+ watingCallback:(nullable TDSGlobalAuthWatingCallback)watingCallback
50
+ errorCallback:(TDSGlobalAuthErrorCallback)errorCallback;
51
+
52
+ + (void)clearInstance;
53
+
54
+ + (void)successCallback:(TDSGlobalAuthSuccessCalback)successCallback authType:(LoginEntryType)authType result:(NSDictionary *)result;
55
+
56
+ + (void)errorCallback:(TDSGlobalAuthErrorCallback)errorCallback error:(NSError *)error cancelCallback:(TDSGlobalAuthCancelCallback)cancelCallback;
57
+
58
+ + (void)cancelCallback:(TDSGlobalAuthCancelCallback)cancelCallback;
59
+ @end
60
+
61
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 6ed90a9641e2549d78e6663a8401bd60
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,47 @@
1
+ //
2
+ // TDSGlobalThirdPartyLoginManager.h
3
+ //
4
+ //
5
+ // Created by JiangJiahao on 2020/8/19.
6
+ // 第三方登录管理
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <XDCommonSDK/XDGEntryType.h>
10
+ #import <UIKit/UIKit.h>
11
+
12
+ @class XDGUser;
13
+ @class TDSGlobalViewControllerBase;
14
+ NS_ASSUME_NONNULL_BEGIN
15
+
16
+ extern NSString *const TDSG_LOGIN_ERROR_DOMAIN;
17
+
18
+ typedef void (^XDGLoginManagerRequestCallback)( XDGUser * _Nullable result,NSError * _Nullable error);
19
+
20
+ typedef void(^XDGLoginSyncCallback)(NSDictionary * _Nullable result,NSError * _Nullable error);
21
+
22
+ typedef NS_ENUM(NSInteger,TDSLoginErrorCode) {
23
+ TDSLoginErrorCodeFail = 0x1002, // fail
24
+ TDSLoginErrorCodeCancel = 0x1003, // user cancel
25
+ TDSLoginErrorCodeNetworkOffline = 0x1004, // no network
26
+ TDSLoginErrorCodeTokenExpired = 0x1005, // fail
27
+ };
28
+
29
+ @interface TDSGlobalThirdPartyLoginManager : NSObject
30
+
31
+ + (void)loginByType:(LoginEntryType)loginType fromViewController:(nullable UIViewController *)viewController handler:(XDGLoginManagerRequestCallback)handler;
32
+
33
+ + (void)failHandler:(NSError *)error handler:(XDGLoginManagerRequestCallback)handler;
34
+
35
+ + (void)failHandler:(NSError *)error handler:(XDGLoginManagerRequestCallback)handler fromSDKLogin:(BOOL)fromSDKLogin;
36
+
37
+ + (void)successHandler:(NSDictionary *)dataDic handler:(XDGLoginManagerRequestCallback)handler loginType:(LoginEntryType)loginType;
38
+
39
+ + (void)getUserProfile:(XDGLoginManagerRequestCallback)handler;
40
+
41
+ + (void)logout:(BOOL)fromAPI withHandler:(nullable void (^)(void))handler;
42
+
43
+ + (void)syncNetConnect:(BOOL)connect syncCallback:(XDGLoginSyncCallback)handle;
44
+
45
+ @end
46
+
47
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 1bb822602cb8347ff8e430d5dd46a9e2
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,24 @@
1
+ //
2
+ // XDAccountSDK.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2022/5/10.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ //! Project version number for XDAccountSDK.
11
+ FOUNDATION_EXPORT double XDAccountSDKVersionNumber;
12
+
13
+ //! Project version string for XDAccountSDK.
14
+ FOUNDATION_EXPORT const unsigned char XDAccountSDKVersionString[];
15
+
16
+ // In this header, you should import all the public headers of your framework using statements like #import <XDAccountSDK/PublicHeader.h>
17
+
18
+ #import <XDAccountSDK/XDGAccount.h>
19
+ #import <XDAccountSDK/TDSGlobalThirdPartyLoginHelper.h>
20
+ #import <XDAccountSDK/TDSGlobalThirdPartyLoginManager.h>
21
+ #import <XDAccountSDK/XDGLoginEntriesConfig.h>
22
+ #import <XDAccountSDK/XDGLoginService.h>
23
+ #import <XDAccountSDK/XDGAccountVersion.h>
24
+ #import <XDAccountSDK/XDGLogger+Account.h>
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 23a5d806a1a41467d8688c786e001066
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,69 @@
1
+
2
+ #import <Foundation/Foundation.h>
3
+ #import <XDCommonSDK/XDCommonSDK.h>
4
+ #import <XDAccountSDK/XDGLoginEntriesConfig.h>
5
+
6
+ NS_ASSUME_NONNULL_BEGIN
7
+
8
+ typedef NS_ENUM(NSInteger,XDGUserStateChangeCode) {
9
+ XDGUserStateChangeCodeLogout = 0x9001, // user logout
10
+ XDGUserStateChangeCodeBindSuccess = 0x1001, // user bind success,msg = entry type in string,eg: @"TAPTAP"
11
+ XDGUserStateChangeCodeUnBindSuccess = 0x1002, // user unbind success,msg = entry type in string
12
+ XDGUserStateChangeCodeProtocolAgreedAfterLogout = 0x2001, // user clicked confirm in agreement dialog showed after logout
13
+ };
14
+
15
+ /**
16
+ Describes the call back to the TDSGlobalLoginManager
17
+ @param result the result of the login request
18
+ @param error error, if any.
19
+ */
20
+ typedef void (^XDGLoginManagerRequestCallback)(XDGUser * _Nullable result, NSError * _Nullable error);
21
+
22
+ typedef void (^XDGBindManagerRequestCallback)(BOOL success, NSError *_Nullable error);
23
+
24
+ typedef void(^XDGLoginSyncCallback)(NSDictionary * _Nullable result,NSError * _Nullable error);
25
+
26
+ /**
27
+ Describes the call back of state of current user
28
+ @param userStateChangeCode user state change type code.
29
+ */
30
+ typedef void (^XDGUserStatusChangeCallback)(XDGUserStateChangeCode userStateChangeCode,NSString *_Nullable message);
31
+
32
+ @interface XDGAccount : NSObject
33
+
34
+ /// Get callback when user state changed
35
+ /// @param handler handler
36
+ + (void)addUserStatusChangeCallback:(XDGUserStatusChangeCallback)handler;
37
+
38
+ /**
39
+ You can customize login buttons in your own ways,and call this methods to login an user.
40
+ Steps:
41
+ 1. use LoginEntryTypeDefault ,check if there was an user logged last time,you will get a result.
42
+ 2. if step 1 failed, show login buttons ,and call with corresponding type when user tapped.
43
+ */
44
+ + (void)loginByType:(LoginEntryType)loginType loginHandler:(XDGLoginManagerRequestCallback)handler;
45
+
46
+ /// Open login Window
47
+ /// @param config login entried config
48
+ /// @param handler login result handler
49
+ + (void)loginWithConfig:(XDGLoginEntriesConfig *)config handler:(XDGLoginManagerRequestCallback)handler;
50
+
51
+ /// Logout current user
52
+ + (void)logout;
53
+
54
+ /// Get current user
55
+ + (void)getUser:(XDGLoginManagerRequestCallback)handler;
56
+
57
+ /// Open usercenter view
58
+ + (void)openUserCenter;
59
+
60
+ /// Open accountCancellation
61
+ + (void)accountCancellation;
62
+
63
+ + (void)bindByType:(LoginEntryType)bindType bindHandler:(XDGBindManagerRequestCallback)handler;
64
+
65
+ + (BOOL)isTokenActiveWithType:(LoginEntryType)type;
66
+
67
+ @end
68
+
69
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 8f0ddc09bb0ed4c07abec2671cc0897a
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ //
2
+ // XDGAccountVersion.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2023/4/14.
6
+ //
7
+ #define XDGAccount_VERSION @"6.21.1"
8
+ // HASH ecb66cb0
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 0cf9f8f5f8e554b0a99f46c48342724c
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,21 @@
1
+ //
2
+ // XDGLogger+Account.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2023/4/14.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <XDCommonSDK/XDGLogger.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @interface XDGLogger (Account)
14
+
15
+ + (void)accountLog:(NSString *)content;
16
+
17
+ + (void)accountSecureLog:(NSString *)content;
18
+
19
+ @end
20
+
21
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 8306ecd1e9f5645b98663bf5e2f1b795
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,16 @@
1
+ //
2
+ // XDGLoginEntriesConfig.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2022/6/8.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface XDGLoginEntriesConfig : NSObject
13
+ @property (nonatomic, strong) NSMutableArray<NSString *> *loginEntryList;
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: df5ca10ce26184d51a4575632d5b3a79
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,47 @@
1
+ //
2
+ // TDSGlobalSDKLoginService.h
3
+ // XDGAccountSDK
4
+ //
5
+ // Created by JiangJiahao on 2020/11/23.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <XDCommonSDK/XDGUser.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @interface XDGLoginService : NSObject
14
+
15
+ //方法名 login 弹框登录
16
+ + (void)login:(NSString*)login bridgeCallback:(void (^)(NSString * _Nonnull))callback;
17
+ + (void)logout;
18
+
19
+ // TDS authentication
20
+ + (void)loginSync:(void(^)(NSString *result))callback;
21
+
22
+ + (void)addUserStatusChangeCallback:(void (^)(NSString *result))callback;
23
+
24
+ + (void)getUser:(void (^)(NSString *result))callback;
25
+
26
+ + (void)openUserCenter;
27
+
28
+ + (void)loginType:(NSString *)loginType bridgeCallback:(void (^)(NSString * _Nonnull))callback;
29
+
30
+ + (void)accountCancellation;
31
+
32
+ + (NSDictionary *)bridgeUserDic:(XDGUser *)user;
33
+
34
+ //641 FB token处理
35
+ + (void)updateThirdPlatformTokenWithCallback:(void (^)(NSString * _Nonnull))callback;
36
+
37
+ + (void)isTokenActiveWithType:(NSString *)isTokenActiveWithType
38
+ bridgeCallback:(void (^)(NSString * _Nonnull))callback;
39
+
40
+ + (void)getFacebookToken:(void (^)(NSString * _Nonnull))callback;
41
+
42
+ + (void)bindByType:(NSString *)bindByType
43
+ bridgeCallback:(void (^)(NSString * _Nonnull))callback;
44
+
45
+ @end
46
+
47
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 592fa979ccca249c493b92cf0137cdb5
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,33 @@
1
+ //
2
+ // XDGPhoneAuthManager.h
3
+ // XDAccountSDK
4
+ //
5
+ // Created by Fattycat on 2023/2/11.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <XDAccountSDK/TDSGlobalThirdPartyLoginManager.h>
10
+ #import <XDAccountSDK/TDSGlobalThirdPartyLoginHelper.h>
11
+ #import <XDCommonSDK/XDGHttpResponse.h>
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+
15
+ typedef void (^XDGPhoneAuthSMSHanlder)(XDGHttpResponse *_Nullable response);
16
+
17
+ @interface XDGPhoneAuthManager : NSObject
18
+
19
+ + (XDGPhoneAuthManager *)sharedInstance;
20
+
21
+ + (void)startPhoneLoginWithHandler:(XDGLoginManagerRequestCallback)handler fromViewController:viewController successCallback:(TDSGlobalAuthSuccessCalback)successCallback cancelCallback:(TDSGlobalAuthCancelCallback)cancelCallback errorCallback:(TDSGlobalAuthErrorCallback)errorCallback;
22
+
23
+ + (void)bindPhoneFromViewController:viewController successCallback:(TDSGlobalAuthSuccessCalback)successCallback cancelCallback:(TDSGlobalAuthCancelCallback)cancelCallback errorCallback:(TDSGlobalAuthErrorCallback)errorCallback;
24
+
25
+ + (void)unbindPhone:(NSString *)phoneNumber;
26
+
27
+ - (void)sendSMS:(NSString *)phoneNumber verify:(NSString *_Nullable)verify fromSMS:(BOOL)fromSMS;
28
+
29
+ - (void)showPhoneLogin:(BOOL)downgrade;
30
+
31
+ @end
32
+
33
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 1b56ec2f7235a477091deeccf435ebd8
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: