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.
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +20 -0
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor/XDAccountMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/XDAccountMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Http/XDGAccountHttpConfigMobile.cs +36 -0
- package/Mobile/Http/XDGAccountHttpConfigMobile.cs.meta +11 -0
- package/Mobile/Http.meta +8 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +15 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta +32 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge.meta +8 -0
- package/Mobile/Plugins/Android/com/xd/account.meta +8 -0
- package/Mobile/Plugins/Android/com/xd.meta +8 -0
- package/Mobile/Plugins/Android/com.meta +8 -0
- package/Mobile/Plugins/Android.meta +8 -0
- package/Mobile/Plugins/iOS/XDAccountBridge.m +26 -0
- package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +37 -0
- package/Mobile/Plugins/iOS.meta +8 -0
- package/Mobile/Plugins.meta +8 -0
- package/Mobile/User/UserManagerMobile.cs +45 -0
- package/Mobile/User/UserManagerMobile.cs.meta +3 -0
- package/Mobile/User.meta +3 -0
- package/Mobile/XD.SDK.Account.Mobile.asmdef +23 -0
- package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +7 -0
- package/Mobile/XDGAccountMobile.cs +132 -0
- package/Mobile/XDGAccountMobile.cs.meta +11 -0
- package/Mobile/XDGAccountMobileImpl.cs +421 -0
- package/Mobile/XDGAccountMobileImpl.cs.meta +11 -0
- package/Mobile/XDGTokenManager.cs +116 -0
- package/Mobile/XDGTokenManager.cs.meta +3 -0
- package/Mobile/XDGUserWrapper.cs +167 -0
- package/Mobile/XDGUserWrapper.cs.meta +11 -0
- package/Mobile.meta +8 -0
- package/Plugins/Android/libs/XDGAccount_6.21.1.aar +0 -0
- package/Plugins/Android/libs/XDGAccount_6.21.1.aar.meta +32 -0
- package/Plugins/Android/libs.meta +8 -0
- package/Plugins/Android.meta +8 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +61 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +47 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +24 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +69 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +8 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +21 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h +16 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h +47 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +33 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h +23 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +8 -0
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap +6 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +8 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework.meta +28 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/README.md +0 -0
- package/README.md.meta +7 -0
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +19 -0
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +7 -0
- package/Runtime/Editor/XDAccountProcessBuild.cs +18 -0
- package/Runtime/Editor/XDAccountProcessBuild.cs.meta +11 -0
- package/Runtime/Editor.meta +8 -0
- package/Runtime/IXDGAccount.cs +42 -0
- package/Runtime/IXDGAccount.cs.meta +3 -0
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +9 -0
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +11 -0
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs +32 -0
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +11 -0
- package/Runtime/Internal/Http.meta +8 -0
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +7 -0
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +3 -0
- package/Runtime/Internal/User.meta +3 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/UserManager.cs +35 -0
- package/Runtime/UserManager.cs.meta +3 -0
- package/Runtime/XD.SDK.Account.asmdef +16 -0
- package/Runtime/XD.SDK.Account.asmdef.meta +7 -0
- package/Runtime/XDGAccessToken.cs +18 -0
- package/Runtime/XDGAccessToken.cs.meta +3 -0
- package/Runtime/XDGAccount.cs +123 -0
- package/Runtime/XDGAccount.cs.meta +3 -0
- package/Runtime/XDGLoginType.cs +28 -0
- package/Runtime/XDGLoginType.cs.meta +3 -0
- package/Runtime/XDGUser.cs +30 -0
- package/Runtime/XDGUser.cs.meta +3 -0
- package/Runtime/XDGUserStatusCode.cs +16 -0
- package/Runtime/XDGUserStatusCode.cs.meta +3 -0
- package/Runtime.meta +3 -0
- package/package.json +11 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XDGTapLoginPermissionDialog.h
|
|
3
|
+
// XDAccountSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by Fattycat on 2023/10/7.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
#import <XDCommonSDK/XDGBaseDialog.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
typedef void (^XDGTapLoginPermissionCheckHandler)(NSString *permission, bool checkd);
|
|
14
|
+
typedef void (^XDGTapLoginPermissionHandler)(NSArray *_Nullable permissionArray, bool close);
|
|
15
|
+
|
|
16
|
+
@interface XDGTapLoginPermissionDialog : XDGBaseDialog
|
|
17
|
+
@property (nonatomic, copy)XDGTapLoginPermissionHandler handler;
|
|
18
|
+
- (instancetype)initWithPermissions:(NSArray *)permissions handler:(XDGTapLoginPermissionHandler)handler;
|
|
19
|
+
|
|
20
|
+
+ (UIView *)generatePermissionViewWithCheckHandler:(XDGTapLoginPermissionCheckHandler)handler permissions:(NSArray *)permissions;
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: aa2c9c4a67fa44bc1862ebd1f8c700c4
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
PluginImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 2
|
|
7
|
+
iconMap: {}
|
|
8
|
+
executionOrder: {}
|
|
9
|
+
defineConstraints: []
|
|
10
|
+
isPreloaded: 0
|
|
11
|
+
isOverridable: 0
|
|
12
|
+
isExplicitlyReferenced: 0
|
|
13
|
+
validateReferences: 1
|
|
14
|
+
platformData:
|
|
15
|
+
- first:
|
|
16
|
+
Any:
|
|
17
|
+
second:
|
|
18
|
+
enabled: 1
|
|
19
|
+
settings: {}
|
|
20
|
+
- first:
|
|
21
|
+
Editor: Editor
|
|
22
|
+
second:
|
|
23
|
+
enabled: 0
|
|
24
|
+
settings:
|
|
25
|
+
DefaultValueInitialized: true
|
|
26
|
+
userData:
|
|
27
|
+
assetBundleName:
|
|
28
|
+
assetBundleVariant:
|
package/Plugins/iOS.meta
ADDED
package/Plugins.meta
ADDED
package/README.md
ADDED
|
File without changes
|
package/README.md.meta
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "XD.SDK.Account",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:0b3f64ec33f5b4da98a17367a35b82f2",
|
|
5
|
+
"GUID:271a06ab0780d4a5ea46c9c3be2ab5dc"
|
|
6
|
+
],
|
|
7
|
+
"includePlatforms": [],
|
|
8
|
+
"excludePlatforms": [],
|
|
9
|
+
"allowUnsafeCode": false,
|
|
10
|
+
"overrideReferences": false,
|
|
11
|
+
"precompiledReferences": [],
|
|
12
|
+
"autoReferenced": true,
|
|
13
|
+
"defineConstraints": [],
|
|
14
|
+
"versionDefines": [],
|
|
15
|
+
"noEngineReferences": false
|
|
16
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using TapTap.Common;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using UnityEngine.Scripting;
|
|
7
|
+
using XD.SDK.Account;
|
|
8
|
+
using XD.SDK.Common;
|
|
9
|
+
using XD.SDK.Account.Internal;
|
|
10
|
+
|
|
11
|
+
using LoginType = XD.SDK.Account.LoginType;
|
|
12
|
+
|
|
13
|
+
[assembly: Preserve]
|
|
14
|
+
[assembly: AlwaysLinkAssembly]
|
|
15
|
+
namespace XD.SDK.Account{
|
|
16
|
+
public class XDGAccount
|
|
17
|
+
{
|
|
18
|
+
private static IXDGAccount platformWrapper;
|
|
19
|
+
public static LoginType LoginType { get; set; }
|
|
20
|
+
|
|
21
|
+
static XDGAccount()
|
|
22
|
+
{
|
|
23
|
+
var interfaceType = typeof(IXDGAccount);
|
|
24
|
+
var platformInterfaceType = AppDomain.CurrentDomain.GetAssemblies()
|
|
25
|
+
.SelectMany(assembly => assembly.GetTypes())
|
|
26
|
+
.FirstOrDefault(clazz => interfaceType.IsAssignableFrom(clazz)&& clazz.IsClass);
|
|
27
|
+
if (platformInterfaceType != null) {
|
|
28
|
+
platformWrapper = Activator.CreateInstance(platformInterfaceType) as IXDGAccount;
|
|
29
|
+
|
|
30
|
+
XDAccountHttpConfig.Init();
|
|
31
|
+
UserManager.Init();
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
{
|
|
35
|
+
TapLogger.Error($"No class implements {interfaceType} Type. Current Platform: {Application.platform}, if you are using Editor, please check if you have installed XDSDK pc module.");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public static void Login(List<LoginType> loginTypes, Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
40
|
+
{
|
|
41
|
+
platformWrapper.Login(loginTypes, callback, errorCallback);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public static void LoginByType(LoginType loginType, Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
45
|
+
{
|
|
46
|
+
LoginType = loginType;
|
|
47
|
+
platformWrapper.LoginByType(loginType, callback, errorCallback);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static void LoginByConsole(Action<XDGUser> successCallback, Action failCallback, Action<XDGError> errorCallback)
|
|
51
|
+
{
|
|
52
|
+
platformWrapper.LoginByConsole(successCallback, failCallback, errorCallback);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public static void Logout()
|
|
56
|
+
{
|
|
57
|
+
platformWrapper.Logout();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public static void AddUserStatusChangeCallback(Action<XDGUserStatusCodeType, string> callback){
|
|
61
|
+
platformWrapper.AddUserStatusChangeCallback(callback);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public static XDGUser GetCurrentUser()
|
|
65
|
+
{
|
|
66
|
+
return UserManager.GetCurrentUser();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public static void GetUser(Action<XDGUser> callback, Action<XDGError> errorCallback)
|
|
70
|
+
{
|
|
71
|
+
platformWrapper.GetUser(callback, errorCallback);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static void OpenUserCenter(){
|
|
75
|
+
platformWrapper.OpenUserCenter();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public static void OpenUnregister(){
|
|
79
|
+
platformWrapper.OpenUnregister();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//641 FB token
|
|
83
|
+
public static void IsTokenActiveWithType(LoginType loginType, Action<bool> callback){
|
|
84
|
+
platformWrapper.IsTokenActiveWithType(loginType, callback);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//除了 Default 和 Guest
|
|
88
|
+
public static void BindByType(LoginType loginType, Action<bool,XDGError> callback){
|
|
89
|
+
platformWrapper.BindByType(loginType, callback);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public static string GetLoginTypeString(LoginType loginType)
|
|
93
|
+
{
|
|
94
|
+
switch (loginType)
|
|
95
|
+
{
|
|
96
|
+
case XD.SDK.Account.LoginType.TapTap:
|
|
97
|
+
return "TapTap";
|
|
98
|
+
case XD.SDK.Account.LoginType.Google:
|
|
99
|
+
return "Google";
|
|
100
|
+
case XD.SDK.Account.LoginType.Facebook:
|
|
101
|
+
return "Facebook";
|
|
102
|
+
case XD.SDK.Account.LoginType.Apple:
|
|
103
|
+
return "Apple";
|
|
104
|
+
case XD.SDK.Account.LoginType.LINE:
|
|
105
|
+
return "LINE";
|
|
106
|
+
case XD.SDK.Account.LoginType.Twitter:
|
|
107
|
+
return "Twitter";
|
|
108
|
+
// case XD.SDK.Account.LoginType.QQ:
|
|
109
|
+
// return "QQ";
|
|
110
|
+
// case XD.SDK.Account.LoginType.Twitch:
|
|
111
|
+
// return "Twitch";
|
|
112
|
+
case XD.SDK.Account.LoginType.Steam:
|
|
113
|
+
return "Steam";
|
|
114
|
+
case XD.SDK.Account.LoginType.Guest:
|
|
115
|
+
return "Guest";
|
|
116
|
+
case XD.SDK.Account.LoginType.Phone:
|
|
117
|
+
return "Phone";
|
|
118
|
+
default:
|
|
119
|
+
return "Default";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
namespace XD.SDK.Account
|
|
2
|
+
{
|
|
3
|
+
public enum LoginType
|
|
4
|
+
{
|
|
5
|
+
Guest = 0, // 游客登录
|
|
6
|
+
WeChat = 1, // PC 未实现
|
|
7
|
+
Apple = 2, // 苹果登录
|
|
8
|
+
Google = 3, // Google 登录
|
|
9
|
+
Facebook = 4, // Facebook 登录
|
|
10
|
+
TapTap = 5, // Tap 登录
|
|
11
|
+
LINE = 6, // PC 未实现
|
|
12
|
+
Twitter = 7, // PC 未实现
|
|
13
|
+
// QQ = 8,
|
|
14
|
+
// Twitch = 9,
|
|
15
|
+
Steam = 10, // Steam 登录
|
|
16
|
+
Phone = 11, // 手机号 登陆
|
|
17
|
+
Default = -1, // 自动登录,以上次登录成功的信息登录
|
|
18
|
+
}
|
|
19
|
+
// ios的,要与后台一致!
|
|
20
|
+
// XDGLoginInfoTypeGuest = 0,
|
|
21
|
+
// XDGLoginInfoTypeWeChat = 1,
|
|
22
|
+
// XDGLoginInfoTypeApple = 2,
|
|
23
|
+
// XDGLoginInfoTypeGoogle = 3,
|
|
24
|
+
// XDGLoginInfoTypeFacebook = 4,
|
|
25
|
+
// XDGLoginInfoTypeTapTap = 5,
|
|
26
|
+
// XDGLoginInfoTypeLine = 6,
|
|
27
|
+
// XDGLoginInfoTypeTwitter = 7
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
|
|
3
|
+
namespace XD.SDK.Account
|
|
4
|
+
{
|
|
5
|
+
public interface XDGUser
|
|
6
|
+
{
|
|
7
|
+
// The _userStandalone's _userStandalone ID.
|
|
8
|
+
string userId { get; }
|
|
9
|
+
|
|
10
|
+
string sub { get; }
|
|
11
|
+
// The _userStandalone's _userStandalone name.
|
|
12
|
+
string name { get; }
|
|
13
|
+
|
|
14
|
+
string loginType //App传来的是字符串,如 TapTap。 通过 GetLoginType() 方法获取枚举
|
|
15
|
+
{
|
|
16
|
+
get;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
string avatar { get; }
|
|
20
|
+
|
|
21
|
+
string nickName { get; }
|
|
22
|
+
|
|
23
|
+
List<string> boundAccounts { get; }
|
|
24
|
+
|
|
25
|
+
// The _userStandalone's token.
|
|
26
|
+
XDGAccessToken token { get; }
|
|
27
|
+
|
|
28
|
+
XD.SDK.Account.LoginType getLoginType();
|
|
29
|
+
}
|
|
30
|
+
}
|