com.xd.sdk.account 6.29.0 → 7.0.0
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.
- package/Plugins/Android/libs/XDGAccount_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta → Plugins/Android/libs/XDGAccount_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java.meta → Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs/XDGSupport_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java.meta → Plugins/Android/libs/XDGSupport_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs.meta +1 -1
- package/Plugins/Android.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +2 -8
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK-Swift.h +329 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/{TDSGlobalThirdPartyLoginManager.h.meta → XDAccountSDK-Swift.h.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +1 -2
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +29 -43
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountDefines.h +43 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/{XDGPhoneAuthManager.h.meta → XDGAccountDefines.h.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +3 -3
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +3 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/{Headers/XDGRoleInfo.h.meta → Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo.meta} +1 -1
- package/{Mobile/Http.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json +9 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule.meta +7 -0
- package/{Mobile/Editor.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework.meta +4 -4
- package/Plugins/iOS.meta +1 -1
- package/Plugins.meta +1 -1
- package/Runtime/Internal/IXDGAccount.Extended.cs +11 -0
- package/{Mobile/Http/XDGAccountHttpConfigMobile.cs.meta → Runtime/Internal/IXDGAccount.Extended.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/AccountFeaturesImpl.cs +348 -0
- package/{Mobile/User/UserManagerMobile.cs.meta → Runtime/Internal/Mobile/AccountFeaturesImpl.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs +14 -0
- package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs.meta +3 -0
- package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs +37 -0
- package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs.meta +3 -0
- package/Runtime/Internal/Mobile/Http.meta +3 -0
- package/{Mobile.meta → Runtime/Internal/Mobile.meta} +1 -1
- package/Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs +168 -0
- package/{Mobile/Editor/XDAccountMobileProcessBuild.cs.meta → Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/AccessToken.meta +8 -0
- package/Runtime/Internal/Standalone/AccountCell.cs +143 -0
- package/{Mobile/XDGAccountMobile.cs.meta → Runtime/Internal/Standalone/AccountCell.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs +461 -0
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/AppleAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/AppleAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/GuestAuth.cs +22 -0
- package/Runtime/Internal/Standalone/Auth/GuestAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs +43 -0
- package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/SteamAuth.cs +90 -0
- package/Runtime/Internal/Standalone/Auth/SteamAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/TapAuth.cs +72 -0
- package/Runtime/Internal/Standalone/Auth/TapAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/WebAuth.cs +144 -0
- package/Runtime/Internal/Standalone/Auth/WebAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth.meta +8 -0
- package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs +15 -0
- package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Compliance.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs +374 -0
- package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Email.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs +245 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs +392 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule.meta +8 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs +228 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs.meta +3 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs +27 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs.meta +3 -0
- package/Runtime/Internal/Standalone/SupportModule.meta +3 -0
- package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs +479 -0
- package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Track.meta +8 -0
- package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs +156 -0
- package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs +295 -0
- package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/Email.meta +8 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs +46 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs +522 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO.meta +8 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs +84 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs +190 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs +164 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification.meta +8 -0
- package/Runtime/Internal/Standalone/UI.meta +8 -0
- package/Runtime/Internal/Standalone/UserCenterAlert.cs +405 -0
- package/Runtime/Internal/Standalone/UserCenterAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UserModule.cs +604 -0
- package/Runtime/Internal/Standalone/UserModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs +47 -0
- package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs.meta +3 -0
- package/Runtime/Internal/Standalone/WebFunction.meta +3 -0
- package/{Mobile/Plugins.meta → Runtime/Internal/Standalone.meta} +1 -1
- package/Runtime/Internal/XDGAccountEventHandler.cs +23 -0
- package/Runtime/Internal/XDGAccountEventHandler.cs.meta +3 -0
- package/Runtime/Internal/XDGAccountInternal.cs +86 -0
- package/Runtime/Internal/XDGAccountInternal.cs.meta +11 -0
- package/Runtime/Internal.meta +1 -1
- package/Runtime/Public/XDGAccount.Deprecated.cs +37 -0
- package/Runtime/Public/XDGAccount.Deprecated.cs.meta +11 -0
- package/Runtime/Public/XDGAccount.cs +107 -0
- package/Runtime/{XDGAccount.cs.meta → Public/XDGAccount.cs.meta} +1 -1
- package/Runtime/Public.meta +8 -0
- package/Runtime/XD.SDK.Account.asmdef +7 -2
- package/Runtime/XD.SDK.Account.asmdef.meta +1 -1
- package/Runtime.meta +1 -1
- package/package.json +5 -5
- package/package.json.meta +2 -2
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +0 -20
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +0 -7
- package/Mobile/Editor/XDAccountMobileProcessBuild.cs +0 -20
- package/Mobile/Http/XDGAccountHttpConfigMobile.cs +0 -36
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +0 -36
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java +0 -16
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java +0 -20
- package/Mobile/Plugins/Android/com/xd/account/bridge.meta +0 -8
- package/Mobile/Plugins/Android/com/xd/account.meta +0 -8
- package/Mobile/Plugins/Android/com/xd.meta +0 -8
- package/Mobile/Plugins/Android/com.meta +0 -8
- package/Mobile/Plugins/Android.meta +0 -8
- package/Mobile/Plugins/iOS/XDAccountBridge.m +0 -29
- package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +0 -37
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h +0 -17
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h.meta +0 -27
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m +0 -23
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m.meta +0 -37
- package/Mobile/Plugins/iOS.meta +0 -8
- package/Mobile/User/UserManagerMobile.cs +0 -45
- package/Mobile/User.meta +0 -8
- package/Mobile/XD.SDK.Account.Mobile.asmdef +0 -23
- package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +0 -7
- package/Mobile/XDGAccountMobile.cs +0 -138
- package/Mobile/XDGAccountMobileImpl.cs +0 -444
- package/Mobile/XDGAccountMobileImpl.cs.meta +0 -11
- package/Mobile/XDGTokenManager.cs +0 -116
- package/Mobile/XDGTokenManager.cs.meta +0 -11
- package/Mobile/XDGUserWrapper.cs +0 -167
- package/Mobile/XDGUserWrapper.cs.meta +0 -11
- package/Plugins/Android/libs/XDGAccount_6.29.0.aar +0 -0
- package/Plugins/Android/libs/XDGAccount_6.29.0.aar.meta +0 -32
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +0 -47
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +0 -33
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGRoleInfo.h +0 -22
- package/README.md +0 -0
- package/README.md.meta +0 -7
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +0 -19
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +0 -7
- package/Runtime/Editor/XDAccountProcessBuild.cs +0 -18
- package/Runtime/Editor/XDAccountProcessBuild.cs.meta +0 -11
- package/Runtime/Editor.meta +0 -8
- package/Runtime/IXDGAccount.cs +0 -44
- package/Runtime/IXDGAccount.cs.meta +0 -11
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +0 -9
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +0 -11
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs +0 -32
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +0 -11
- package/Runtime/Internal/Http.meta +0 -8
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +0 -7
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +0 -11
- package/Runtime/Internal/User.meta +0 -8
- package/Runtime/UserManager.cs +0 -35
- package/Runtime/UserManager.cs.meta +0 -11
- package/Runtime/XDGAccessToken.cs +0 -18
- package/Runtime/XDGAccessToken.cs.meta +0 -11
- package/Runtime/XDGAccount.cs +0 -130
- package/Runtime/XDGLoginType.cs +0 -17
- package/Runtime/XDGLoginType.cs.meta +0 -11
- package/Runtime/XDGRoleInfo.cs +0 -24
- package/Runtime/XDGRoleInfo.cs.meta +0 -11
- package/Runtime/XDGUser.cs +0 -30
- package/Runtime/XDGUser.cs.meta +0 -11
- package/Runtime/XDGUserStatusCode.cs +0 -16
- package/Runtime/XDGUserStatusCode.cs.meta +0 -11
package/Mobile/XDGUserWrapper.cs
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
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
|
-
}
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 9491f21dfa052431480ebc2a287505f5
|
|
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:
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// XDGRoleInfo.h
|
|
3
|
-
// XDAccountSDK
|
|
4
|
-
//
|
|
5
|
-
// Created by Fattycat on 2024/9/29.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
-
|
|
12
|
-
@interface XDGRoleInfo : NSObject
|
|
13
|
-
|
|
14
|
-
@property (nonatomic, nullable, copy) NSString *roleId;
|
|
15
|
-
@property (nonatomic, nullable, copy) NSString *roleName;
|
|
16
|
-
@property (nonatomic, nullable, copy) NSString *serverId;
|
|
17
|
-
@property (nonatomic, nullable, copy) NSString *extra;
|
|
18
|
-
|
|
19
|
-
- (NSDictionary *)toDictionary;
|
|
20
|
-
@end
|
|
21
|
-
|
|
22
|
-
NS_ASSUME_NONNULL_END
|
package/README.md
DELETED
|
File without changes
|
package/README.md.meta
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "XD.SDK.Account.Editor",
|
|
3
|
-
"references": [
|
|
4
|
-
"GUID:616cea76def2d4f059b94440fc8cc03d",
|
|
5
|
-
"GUID:0acc523941302664db1f4e527237feb3",
|
|
6
|
-
"GUID:27619889b8ba8c24980f49ee34dbb44a"
|
|
7
|
-
],
|
|
8
|
-
"includePlatforms": [
|
|
9
|
-
"Editor"
|
|
10
|
-
],
|
|
11
|
-
"excludePlatforms": [],
|
|
12
|
-
"allowUnsafeCode": false,
|
|
13
|
-
"overrideReferences": false,
|
|
14
|
-
"precompiledReferences": [],
|
|
15
|
-
"autoReferenced": true,
|
|
16
|
-
"defineConstraints": [],
|
|
17
|
-
"versionDefines": [],
|
|
18
|
-
"noEngineReferences": false
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using TapTap.Common.Editor;
|
|
3
|
-
using UnityEditor.Build.Reporting;
|
|
4
|
-
|
|
5
|
-
namespace XD.SDK.Account.Editor
|
|
6
|
-
{
|
|
7
|
-
public class XDAccountProcessBuild : SDKLinkProcessBuild {
|
|
8
|
-
public override int callbackOrder => 5;
|
|
9
|
-
|
|
10
|
-
public override string LinkPath => "XDSDK/Gen/Account/link.xml";
|
|
11
|
-
|
|
12
|
-
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
13
|
-
new LinkedAssembly { Fullname = "XD.SDK.Account" },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
public override Func<BuildReport, bool> IsTargetPlatform => (report) => true;
|
|
17
|
-
}
|
|
18
|
-
}
|
package/Runtime/Editor.meta
DELETED
package/Runtime/IXDGAccount.cs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using XD.SDK.Common;
|
|
4
|
-
using LoginType = XD.SDK.Account.LoginType;
|
|
5
|
-
|
|
6
|
-
namespace XD.SDK.Account{
|
|
7
|
-
public interface IXDGAccount
|
|
8
|
-
{
|
|
9
|
-
void Login(List<LoginType> loginTypes, Action<XDGUser> callback,
|
|
10
|
-
Action<XDGError> errorCallback);
|
|
11
|
-
|
|
12
|
-
void LoginByType(LoginType loginType, Action<XDGUser> callback,
|
|
13
|
-
Action<XDGError> errorCallback);
|
|
14
|
-
|
|
15
|
-
/// <summary>
|
|
16
|
-
/// 发行在主机(Steam/PS/Nintendo)上的游戏的自动登录接口
|
|
17
|
-
/// </summary>
|
|
18
|
-
/// <param name="successCallback">该主机的账号注册过心动账号,那么会返回登录成功(第二次登录的时候,如果主机账号没有发生改变,会直接返回登录成功,略过网络请求)</param>
|
|
19
|
-
/// <param name="failCallback">该主机的账号未注册过心动账号,那么会返回失败。这个时候需要调用LoginByType登录</param>
|
|
20
|
-
/// <param name="errorCallback">网络请求错误或者非主机平台的游戏调用,以及其他错误</param>
|
|
21
|
-
void LoginByConsole(Action<XDGUser> successCallback, Action failCallback,
|
|
22
|
-
Action<XDGError> errorCallback);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
void Logout();
|
|
26
|
-
|
|
27
|
-
void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback);
|
|
28
|
-
|
|
29
|
-
void GetUser(Action<XDGUser> callback, Action<XDGError> errorCallback);
|
|
30
|
-
|
|
31
|
-
void OpenUserCenter();
|
|
32
|
-
|
|
33
|
-
void OpenUnregister();
|
|
34
|
-
|
|
35
|
-
//641 FB token
|
|
36
|
-
void IsTokenActiveWithType(LoginType loginType, Action<bool> callback);
|
|
37
|
-
|
|
38
|
-
//除了 Default 和 Guest
|
|
39
|
-
void BindByType(LoginType loginType, Action<bool, XDGError> callback);
|
|
40
|
-
|
|
41
|
-
void OpenUserDashboard(XDGRoleInfo roleInfo);
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
using System.Collections.Generic;
|
|
2
|
-
using System.Threading.Tasks;
|
|
3
|
-
using System.Net.Http;
|
|
4
|
-
|
|
5
|
-
namespace XD.SDK.Account.Internal {
|
|
6
|
-
public interface IXDAccountHttpConfig {
|
|
7
|
-
Task<Dictionary<string, string>> GetAuthorizationHeaders(HttpRequestMessage request, long timestamp);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Linq;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using System.Threading.Tasks;
|
|
5
|
-
using System.Net.Http;
|
|
6
|
-
using XD.SDK.Common;
|
|
7
|
-
using XD.SDK.Common.Internal;
|
|
8
|
-
using UnityEngine;
|
|
9
|
-
|
|
10
|
-
namespace XD.SDK.Account.Internal {
|
|
11
|
-
public class XDAccountHttpConfig {
|
|
12
|
-
private static IXDAccountHttpConfig platformWrapper;
|
|
13
|
-
|
|
14
|
-
public static void Init() {
|
|
15
|
-
var interfaceType = typeof(IXDAccountHttpConfig);
|
|
16
|
-
var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
|
|
17
|
-
.SelectMany(assembly => assembly.GetTypes())
|
|
18
|
-
.FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
|
|
19
|
-
if (platformInterfaceType != null) {
|
|
20
|
-
platformWrapper = Activator.CreateInstance(platformInterfaceType) as IXDAccountHttpConfig;
|
|
21
|
-
|
|
22
|
-
XDHttpClientFactory.RegisterHeadersTaskFunc(GetAuthorizationHeaders);
|
|
23
|
-
} else {
|
|
24
|
-
XDGLogger.Error($"No class implements {interfaceType} Type. Current Platform: {Application.platform}, if you are using Editor, please check if you have installed XDSDK pc module.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public static Task<Dictionary<string, string>> GetAuthorizationHeaders(HttpRequestMessage request, long timestamp) {
|
|
29
|
-
return platformWrapper.GetAuthorizationHeaders(request, timestamp);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
package/Runtime/UserManager.cs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Linq;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
using XD.SDK.Account.Internal;
|
|
5
|
-
using XD.SDK.Common;
|
|
6
|
-
|
|
7
|
-
namespace XD.SDK.Account
|
|
8
|
-
{
|
|
9
|
-
public class UserManager
|
|
10
|
-
{
|
|
11
|
-
private static IUserManagerPlatformWrapper _platformWrapper;
|
|
12
|
-
|
|
13
|
-
public static void Init()
|
|
14
|
-
{
|
|
15
|
-
var interfaceType = typeof(IUserManagerPlatformWrapper);
|
|
16
|
-
var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
|
|
17
|
-
.SelectMany(assembly => assembly.GetTypes())
|
|
18
|
-
.FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
|
|
19
|
-
|
|
20
|
-
if (platformInterfaceType != null)
|
|
21
|
-
{
|
|
22
|
-
_platformWrapper = Activator.CreateInstance(platformInterfaceType) as IUserManagerPlatformWrapper;
|
|
23
|
-
}
|
|
24
|
-
else
|
|
25
|
-
{
|
|
26
|
-
XDGLogger.Error($"No class implements {interfaceType} Type. Current Platform : {Application.platform}, if you are using Editor, , please check if you have installed XDSDK pc module.");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public static XDGUser GetCurrentUser()
|
|
31
|
-
{
|
|
32
|
-
return _platformWrapper.GetCurrentUser();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|