com.xd.sdk.account 6.29.1 → 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.1.aar +0 -0
- package/Plugins/Android/libs/XDGAccount_6.29.1.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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using XD.SDK.Common.Internal.Events;
|
|
3
|
+
|
|
4
|
+
#if UNITY_EDITOR || UNITY_STANDALONE
|
|
5
|
+
using XD.SDK.Account.Internal.Standalone;
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
namespace XD.SDK.Account
|
|
9
|
+
{
|
|
10
|
+
public static class XDGAccountEventHandler
|
|
11
|
+
{
|
|
12
|
+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
|
13
|
+
static void RegisterEventHandlers()
|
|
14
|
+
{
|
|
15
|
+
XDGEventBus.Subscribe(XDGEvents.AccountGetCurrentUser, _ => XDGAccount.GetCurrentUser());
|
|
16
|
+
#if UNITY_EDITOR || UNITY_STANDALONE
|
|
17
|
+
XDGEventBus.SubscribeAsync(XDGEvents.AccountGetAccessToken, async _ => await AccessTokenModule.GetLocalAccessToken());
|
|
18
|
+
|
|
19
|
+
XDGEventBus.Subscribe(XDGEvents.AccountSupportStartPolling, _ => SupportModule.Instance.TryStartPolling());
|
|
20
|
+
#endif
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using System.Net.Http;
|
|
5
|
+
using System.Threading.Tasks;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using XD.SDK.Common;
|
|
8
|
+
using XD.SDK.Common.Internal;
|
|
9
|
+
|
|
10
|
+
namespace XD.SDK.Account
|
|
11
|
+
{
|
|
12
|
+
internal class XDGAccountInternal
|
|
13
|
+
{
|
|
14
|
+
private static IXDGAccountExtended _platformWrapper;
|
|
15
|
+
|
|
16
|
+
static XDGAccountInternal()
|
|
17
|
+
{
|
|
18
|
+
#if UNITY_IOS || UNITY_ANDROID
|
|
19
|
+
_platformWrapper = XD.SDK.Account.Internal.Mobile.AccountFeaturesImpl.Instance;
|
|
20
|
+
#elif UNITY_STANDALONE
|
|
21
|
+
_platformWrapper = XD.SDK.Account.Internal.Standalone.AccountFeaturesImpl.Instance;
|
|
22
|
+
#endif
|
|
23
|
+
if (_platformWrapper == null)
|
|
24
|
+
{
|
|
25
|
+
XDGLogger.Error("unsupported platform: " + Application.platform);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
internal static void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback)
|
|
30
|
+
{
|
|
31
|
+
_platformWrapper.AddUserStatusChangeCallback(callback);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
internal static void LoginByType(LoginType loginType, Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
35
|
+
{
|
|
36
|
+
_platformWrapper.LoginByType(loginType, callback, errorCallback);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// internal static void LoginByConsole(Action<XDGUser> successCallback, Action failCallback,
|
|
40
|
+
// Action<XDGError> errorCallback)
|
|
41
|
+
// {
|
|
42
|
+
// _platformWrapper.LoginByConsole(successCallback, failCallback, errorCallback);
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
internal static void Logout()
|
|
46
|
+
{
|
|
47
|
+
_platformWrapper.Logout();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
internal static XDGUser GetCurrentUser()
|
|
51
|
+
{
|
|
52
|
+
return _platformWrapper.GetCurrentUser();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
internal static void OpenCustomerService(XDGRoleInfo roleInfo, string path, Dictionary<string, object> paramsMap)
|
|
56
|
+
{
|
|
57
|
+
_platformWrapper.OpenCustomerService(roleInfo, path, paramsMap);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
internal static void OpenUserCenter()
|
|
61
|
+
{
|
|
62
|
+
_platformWrapper.OpenUserCenter();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
internal static void OpenUserDashboard(XDGRoleInfo roleInfo)
|
|
66
|
+
{
|
|
67
|
+
_platformWrapper.OpenUserDashboard(roleInfo);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
internal static void OpenAccountDeletion()
|
|
71
|
+
{
|
|
72
|
+
_platformWrapper.OpenAccountDeletion();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
internal static void BindByType(LoginType loginType, Action<bool, XDGError> callback)
|
|
76
|
+
{
|
|
77
|
+
_platformWrapper.BindByType(loginType, callback);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
internal static Task<Dictionary<string, string>> GetRequestAuthorizationHeader(HttpRequestMessage request,
|
|
81
|
+
long timestamp)
|
|
82
|
+
{
|
|
83
|
+
return _platformWrapper.GetRequestAuthorizationHeader(request, timestamp);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
package/Runtime/Internal.meta
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#if XDSDK_DEPRECATED
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using XD.SDK.Common;
|
|
5
|
+
|
|
6
|
+
namespace XD.SDK.Account
|
|
7
|
+
{
|
|
8
|
+
partial class XDGAccount
|
|
9
|
+
{
|
|
10
|
+
[Obsolete("Deprecated in XDSDK 7.x")]
|
|
11
|
+
public static void Login(List<LoginType> loginTypes, Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
12
|
+
{
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[Obsolete("Deprecated in XDSDK 7.x")]
|
|
17
|
+
public static void GetUser(Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
18
|
+
{
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[Obsolete("Deprecated in XDSDK 7.x")]
|
|
22
|
+
public static void OpenUnregister()
|
|
23
|
+
{
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[Obsolete("Deprecated in XDSDK 7.x")]
|
|
27
|
+
public static void IsTokenActiveWithType(LoginType loginType, Action<bool> callback){
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[Obsolete("Deprecated in XDSDK 7.x")]
|
|
31
|
+
public static string GetLoginTypeString(LoginType loginType)
|
|
32
|
+
{
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine.Scripting;
|
|
4
|
+
using XD.SDK.Account.Internal;
|
|
5
|
+
using XD.SDK.Common;
|
|
6
|
+
|
|
7
|
+
[assembly: Preserve]
|
|
8
|
+
[assembly: AlwaysLinkAssembly]
|
|
9
|
+
|
|
10
|
+
namespace XD.SDK.Account
|
|
11
|
+
{
|
|
12
|
+
public static partial class XDGAccount
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// 注册用户状态变化回调
|
|
16
|
+
/// </summary>
|
|
17
|
+
/// <param name="callback"></param>
|
|
18
|
+
public static void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback)
|
|
19
|
+
{
|
|
20
|
+
XDGAccountInternal.AddUserStatusChangeCallback(callback);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
/// 开始登录
|
|
25
|
+
/// </summary>
|
|
26
|
+
/// <param name="loginType">授权类型</param>
|
|
27
|
+
/// <param name="successCallback">登录成功回调</param>
|
|
28
|
+
/// <param name="errorCallback">登录失败回调</param>
|
|
29
|
+
public static void LoginByType(LoginType loginType, Action<XDGUser> successCallback,
|
|
30
|
+
Action<XDGError> errorCallback)
|
|
31
|
+
{
|
|
32
|
+
XDGAccountInternal.LoginByType(loginType, successCallback, errorCallback);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static void LoginByConsole(Action<XDGUser> successCallback, Action failCallback,
|
|
36
|
+
Action<XDGError> errorCallback)
|
|
37
|
+
{
|
|
38
|
+
XDGAccountInternal.LoginByType(LoginType.Console, successCallback, errorCallback);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
/// 退出登录
|
|
43
|
+
/// </summary>
|
|
44
|
+
public static void Logout()
|
|
45
|
+
{
|
|
46
|
+
XDGAccountInternal.Logout();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// <summary>
|
|
50
|
+
/// 获取当前用户信息
|
|
51
|
+
/// </summary>
|
|
52
|
+
/// <returns></returns>
|
|
53
|
+
public static XDGUser GetCurrentUser()
|
|
54
|
+
{
|
|
55
|
+
return XDGAccountInternal.GetCurrentUser();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
/// 打开客服页面
|
|
60
|
+
/// </summary>
|
|
61
|
+
/// <param name="roleInfo">角色信息</param>
|
|
62
|
+
/// <param name="path">XDSDK 客服路径</param>
|
|
63
|
+
/// <param name="paramsMap">XDSDK 客服透传数据</param>
|
|
64
|
+
public static void OpenCustomerService(XDGRoleInfo roleInfo, string path, Dictionary<string, object> paramsMap)
|
|
65
|
+
{
|
|
66
|
+
XDGAccountInternal.OpenCustomerService(roleInfo, path, paramsMap);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// 打开用户中心
|
|
71
|
+
/// </summary>
|
|
72
|
+
public static void OpenUserCenter(XDGRoleInfo roleInfo)
|
|
73
|
+
{
|
|
74
|
+
XDGAccountInternal.OpenUserCenter();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
/// 打开个人信息页面
|
|
79
|
+
/// Tips: 仅在国内可用
|
|
80
|
+
/// Tips: 在 PNSDK 环境下不可用
|
|
81
|
+
/// </summary>
|
|
82
|
+
/// <param name="roleInfo"></param>
|
|
83
|
+
public static void OpenUserDashboard(XDGRoleInfo roleInfo)
|
|
84
|
+
{
|
|
85
|
+
XDGAccountInternal.OpenUserDashboard(roleInfo);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// <summary>
|
|
89
|
+
/// 打开注销页面
|
|
90
|
+
/// Tips: 在 PNSDK 环境下不可用
|
|
91
|
+
/// </summary>
|
|
92
|
+
public static void OpenAccountDeletion()
|
|
93
|
+
{
|
|
94
|
+
XDGAccountInternal.OpenAccountDeletion();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// <summary>
|
|
98
|
+
/// 绑定账号
|
|
99
|
+
/// </summary>
|
|
100
|
+
/// <param name="loginType">账号类型</param>
|
|
101
|
+
/// <param name="callback">绑定回调</param>
|
|
102
|
+
public static void BindByType(LoginType loginType, Action<bool, XDGError> callback)
|
|
103
|
+
{
|
|
104
|
+
XDGAccountInternal.BindByType(loginType, callback);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "XD.SDK.Account",
|
|
3
|
+
"rootNamespace": "",
|
|
3
4
|
"references": [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
5
|
+
"XD.SDK.Common",
|
|
6
|
+
"XD.SDK.Foundation",
|
|
7
|
+
"Vuplex.WebView",
|
|
8
|
+
"Unity.TextMeshPro",
|
|
9
|
+
"TapTap.Common.Runtime",
|
|
10
|
+
"TapTap.Login.Runtime"
|
|
6
11
|
],
|
|
7
12
|
"includePlatforms": [],
|
|
8
13
|
"excludePlatforms": [],
|
package/Runtime.meta
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.account",
|
|
3
|
-
"displayName": "
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
6
|
-
"unity": "
|
|
3
|
+
"displayName": "XDGSDK Account",
|
|
4
|
+
"version": "7.0.0",
|
|
5
|
+
"description": "XDGSDK",
|
|
6
|
+
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.
|
|
9
|
+
"com.xd.sdk.common": "7.0.0"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/package.json.meta
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "XD.SDK.Account.Mobile.Editor",
|
|
3
|
-
"references": [
|
|
4
|
-
"GUID:616cea76def2d4f059b94440fc8cc03d",
|
|
5
|
-
"GUID:747e53b1749584bae9386571797e5eb5",
|
|
6
|
-
"GUID:0acc523941302664db1f4e527237feb3",
|
|
7
|
-
"GUID:27619889b8ba8c24980f49ee34dbb44a"
|
|
8
|
-
],
|
|
9
|
-
"includePlatforms": [
|
|
10
|
-
"Editor"
|
|
11
|
-
],
|
|
12
|
-
"excludePlatforms": [],
|
|
13
|
-
"allowUnsafeCode": false,
|
|
14
|
-
"overrideReferences": false,
|
|
15
|
-
"precompiledReferences": [],
|
|
16
|
-
"autoReferenced": true,
|
|
17
|
-
"defineConstraints": [],
|
|
18
|
-
"versionDefines": [],
|
|
19
|
-
"noEngineReferences": false
|
|
20
|
-
}
|
|
@@ -1,20 +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 XDAccountMobileProcessBuild : SDKLinkProcessBuild {
|
|
8
|
-
public override int callbackOrder => 6;
|
|
9
|
-
|
|
10
|
-
public override string LinkPath => "XDSDK/Gen/Account/Mobile/link.xml";
|
|
11
|
-
|
|
12
|
-
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
13
|
-
new LinkedAssembly { Fullname = "XD.SDK.Account.Mobile" }
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
|
17
|
-
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using System.Net.Http;
|
|
4
|
-
using System.Threading.Tasks;
|
|
5
|
-
using System.Runtime.InteropServices;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace XD.SDK.Account.Internal {
|
|
9
|
-
public class XDGAccountHttpConfigMobile : IXDAccountHttpConfig {
|
|
10
|
-
public Task<Dictionary<string, string>> GetAuthorizationHeaders(HttpRequestMessage request, long timestamp) {
|
|
11
|
-
string url = request.RequestUri.AbsoluteUri;
|
|
12
|
-
string method = request.Method.ToString().ToUpper();
|
|
13
|
-
string authorization;
|
|
14
|
-
#if UNITY_ANDROID
|
|
15
|
-
using (AndroidJavaClass AccountBridgeClass = new AndroidJavaClass("com.xd.account.bridge.XDGAccountBridge")) {
|
|
16
|
-
authorization = AccountBridgeClass.CallStatic<string>("getAuthorization", url, method, timestamp);
|
|
17
|
-
}
|
|
18
|
-
#elif UNITY_IOS
|
|
19
|
-
IntPtr ptr = XDAccountBridgeGetAuthorization(url, method, timestamp);
|
|
20
|
-
authorization = Marshal.PtrToStringAnsi(ptr);
|
|
21
|
-
#endif
|
|
22
|
-
if (string.IsNullOrEmpty(authorization)) {
|
|
23
|
-
return Task.FromResult(new Dictionary<string, string>());
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return Task.FromResult(new Dictionary<string, string> {
|
|
27
|
-
{ "Authorization", authorization }
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#if UNITY_IOS
|
|
32
|
-
[DllImport("__Internal")]
|
|
33
|
-
private static extern IntPtr XDAccountBridgeGetAuthorization(string url, string method, long timestamp);
|
|
34
|
-
#endif
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
package com.xd.account.bridge;
|
|
2
|
-
|
|
3
|
-
import android.os.Handler;
|
|
4
|
-
import android.os.Looper;
|
|
5
|
-
|
|
6
|
-
import com.xd.intl.common.net.CommonParameterManager;
|
|
7
|
-
import com.xd.intl.common.bridge.BridgeUtil;
|
|
8
|
-
import com.xd.intl.common.global.GlobalUserStore;
|
|
9
|
-
import com.xd.intl.account.XDGAccount;
|
|
10
|
-
import com.xd.intl.account.v2.entity.RoleInfo;
|
|
11
|
-
|
|
12
|
-
public class XDGAccountBridge {
|
|
13
|
-
public static String getAuthorization(String url, String method, long timestamp) {
|
|
14
|
-
return CommonParameterManager.getInstance().getRequestAuthorizationHeaderString(url, method, timestamp * 1000);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public static String getCurrentUser() {
|
|
18
|
-
return BridgeUtil.convertUserJsonString4Bridge(GlobalUserStore.INSTANCE.getCurrentXDUser());
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public static void openUserDashboard (String roleId, String roleName, String serverId, String extra){
|
|
22
|
-
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
23
|
-
@Override
|
|
24
|
-
public void run() {
|
|
25
|
-
XDGAccount.openUserDashboard(
|
|
26
|
-
RoleInfo.newBuilder()
|
|
27
|
-
.setRoleId(roleId)
|
|
28
|
-
.setRoleName(roleName)
|
|
29
|
-
.setServerId(serverId)
|
|
30
|
-
.setExtra(extra)
|
|
31
|
-
.build()
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
package com.xd.account.bridge;
|
|
2
|
-
|
|
3
|
-
import com.tds.common.bridge.IBridgeService;
|
|
4
|
-
import com.tds.common.bridge.annotation.BridgeMethod;
|
|
5
|
-
import com.tds.common.bridge.annotation.BridgeParam;
|
|
6
|
-
import com.tds.common.bridge.annotation.BridgeService;
|
|
7
|
-
|
|
8
|
-
@BridgeService("XDGLoginServiceUnity")
|
|
9
|
-
public interface XDGLoginServiceUnity extends IBridgeService {
|
|
10
|
-
|
|
11
|
-
@BridgeMethod("openUserDashboard")
|
|
12
|
-
void openUserDashboard(@BridgeParam("serverId") String serverId,
|
|
13
|
-
@BridgeParam("roleId") String roleId,
|
|
14
|
-
@BridgeParam("roleName") String roleName,
|
|
15
|
-
@BridgeParam("extra") String extra);
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
package com.xd.account.bridge;
|
|
2
|
-
|
|
3
|
-
import com.xd.intl.account.XDGAccount;
|
|
4
|
-
import com.xd.intl.account.v2.entity.RoleInfo;
|
|
5
|
-
|
|
6
|
-
public class XDGLoginServiceUnityImpl implements XDGLoginServiceUnity {
|
|
7
|
-
private static final String TAG = XDGLoginServiceUnity.class.getSimpleName();
|
|
8
|
-
|
|
9
|
-
@Override
|
|
10
|
-
public void openUserDashboard(String serverId, String roleId, String roleName, String extra) {
|
|
11
|
-
XDGAccount.openUserDashboard(
|
|
12
|
-
RoleInfo.newBuilder()
|
|
13
|
-
.setRoleId(roleId)
|
|
14
|
-
.setRoleName(roleName)
|
|
15
|
-
.setServerId(serverId)
|
|
16
|
-
.setExtra(extra)
|
|
17
|
-
.build()
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// XDAccountBridge.m
|
|
3
|
-
// Unity-iPhone
|
|
4
|
-
//
|
|
5
|
-
// Created by oneRain on 2024/3/6.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <XDCommonSDK/XDGHttpRequest.h>
|
|
10
|
-
#import <XDCommonSDK/XDGUser.h>
|
|
11
|
-
#import <XDAccountSDK/XDGLoginService.h>
|
|
12
|
-
#import <XDAccountSDK/XDGAccount.h>
|
|
13
|
-
#import <XDCommonSDK/NSDictionary+TDSGlobalJson.h>
|
|
14
|
-
|
|
15
|
-
const char* XDAccountBridgeGetAuthorization(const char* url, const char* method, long timestamp) {
|
|
16
|
-
NSString *auth = [XDGHttpRequest getMactoken:[NSURL URLWithString:[NSString stringWithUTF8String:url]] method:[NSString stringWithUTF8String:method] time:[[NSNumber numberWithLong:timestamp] stringValue]];
|
|
17
|
-
return [auth UTF8String];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const char*XDAccountBridgeGetUser() {
|
|
21
|
-
XDGUser *user = [XDGUser currentUser];
|
|
22
|
-
if (user.userId == nil || user.userId.length == 0) {
|
|
23
|
-
return nil;
|
|
24
|
-
}
|
|
25
|
-
NSDictionary *userDic = [XDGLoginService bridgeUserDic:user];
|
|
26
|
-
return [userDic.tdsglobal_jsonString UTF8String];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 66125dbb432024524bd6984a09e3deb3
|
|
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
|
-
Any:
|
|
16
|
-
second:
|
|
17
|
-
enabled: 0
|
|
18
|
-
settings: {}
|
|
19
|
-
- first:
|
|
20
|
-
Editor: Editor
|
|
21
|
-
second:
|
|
22
|
-
enabled: 0
|
|
23
|
-
settings:
|
|
24
|
-
DefaultValueInitialized: true
|
|
25
|
-
- first:
|
|
26
|
-
iPhone: iOS
|
|
27
|
-
second:
|
|
28
|
-
enabled: 1
|
|
29
|
-
settings: {}
|
|
30
|
-
- first:
|
|
31
|
-
tvOS: tvOS
|
|
32
|
-
second:
|
|
33
|
-
enabled: 1
|
|
34
|
-
settings: {}
|
|
35
|
-
userData:
|
|
36
|
-
assetBundleName:
|
|
37
|
-
assetBundleVariant:
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// XDGLoginServiceUnity.h
|
|
3
|
-
// XDCommonSDK
|
|
4
|
-
//
|
|
5
|
-
// Created by 韩志强 on 2024/10/12.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
-
|
|
12
|
-
@interface XDGLoginServiceUnity : NSObject
|
|
13
|
-
// openUserDashboard
|
|
14
|
-
+ (void)serverId:(NSString* )serverId roleId:(NSString *)roleId roleName:(NSString *)roleName extra:(NSString *)extra;
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
NS_ASSUME_NONNULL_END
|