com.xd.sdk.account 6.22.4 → 6.23.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/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java +16 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java.meta +3 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java +20 -0
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java.meta +3 -0
- package/Mobile/Plugins/iOS/XDAccountBridge.m +1 -16
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h +17 -0
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h.meta +3 -0
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m +23 -0
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m.meta +3 -0
- package/Mobile/XDGAccountMobile.cs +1 -2
- package/Mobile/XDGAccountMobileImpl.cs +22 -1
- package/Plugins/Android/libs/XDGAccount_6.23.0.aar +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +2 -2
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGRoleInfo.h.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
- package/package.json +2 -2
- package/Mobile/Bridge/AccountMobile.cs +0 -42
- package/Mobile/Bridge/AccountMobile.cs.meta +0 -3
- package/Mobile/Bridge.meta +0 -3
- package/Plugins/Android/libs/XDGAccount_6.22.4.aar +0 -0
- /package/Plugins/Android/libs/{XDGAccount_6.22.4.aar.meta → XDGAccount_6.23.0.aar.meta} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -26,19 +26,4 @@ const char*XDAccountBridgeGetUser() {
|
|
|
26
26
|
return [userDic.tdsglobal_jsonString UTF8String];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
XDGRoleInfo *roleInfo = [XDGRoleInfo new];
|
|
31
|
-
if (roleId){
|
|
32
|
-
roleInfo.roleId = [NSString stringWithUTF8String:roleId];
|
|
33
|
-
}
|
|
34
|
-
if (roleName){
|
|
35
|
-
roleInfo.roleName = [NSString stringWithUTF8String:roleName];
|
|
36
|
-
}
|
|
37
|
-
if (serverId){
|
|
38
|
-
roleInfo.serverId = [NSString stringWithUTF8String:serverId];
|
|
39
|
-
}
|
|
40
|
-
if (extra){
|
|
41
|
-
roleInfo.extra = [NSString stringWithUTF8String:extra];
|
|
42
|
-
}
|
|
43
|
-
[XDGAccount openUserDashboardWithInfo:roleInfo];
|
|
44
|
-
}
|
|
29
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XDGLoginServiceUnity.m
|
|
3
|
+
// XDCommonSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by 韩志强 on 2024/10/12.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XDGLoginServiceUnity.h"
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "XDAccountSDK/XDGAccount.h"
|
|
11
|
+
|
|
12
|
+
@implementation XDGLoginServiceUnity
|
|
13
|
+
|
|
14
|
+
+ (void)serverId:(NSString* )serverId roleId:(NSString *)roleId roleName:(NSString *)roleName extra:(NSString *)extra {
|
|
15
|
+
XDGRoleInfo *roleInfo = [[XDGRoleInfo alloc] init];
|
|
16
|
+
roleInfo.serverId = serverId;
|
|
17
|
+
roleInfo.roleId = roleId;
|
|
18
|
+
roleInfo.roleName = roleName;
|
|
19
|
+
roleInfo.extra = extra;
|
|
20
|
+
[XDGAccount openUserDashboardWithInfo:roleInfo];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using XD.SDK.Account;
|
|
5
|
-
using XD.SDK.Account.Mobile.Bridge;
|
|
6
5
|
using XD.SDK.Common;
|
|
7
6
|
using LoginType = XD.SDK.Account.LoginType;
|
|
8
7
|
|
|
@@ -130,7 +129,7 @@ namespace XD.SDK.Account{
|
|
|
130
129
|
|
|
131
130
|
public void OpenUserDashboard(XDGRoleInfo roleInfo)
|
|
132
131
|
{
|
|
133
|
-
|
|
132
|
+
XDGAccountMobileImpl.GetInstance().OpenUserDashboard(roleInfo);
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
#endregion
|
|
@@ -14,12 +14,17 @@ namespace XD.SDK.Account{
|
|
|
14
14
|
//Account
|
|
15
15
|
private static string ACCOUNT_SERVICE_NAME = "com.xd.intl.account.unitybridge.XDGLoginService";
|
|
16
16
|
private static string ACCOUNT_SERVICE_IMPL = "com.xd.intl.account.unitybridge.XDGLoginServiceImpl";
|
|
17
|
+
private static string ACCOUNT_SERVICE_NAME_UNITY = "com.xd.account.bridge.XDGLoginServiceUnity";
|
|
18
|
+
private static string ACCOUNT_SERVICE_IMPL_UNITY = "com.xd.account.bridge.XDGLoginServiceUnityImpl";
|
|
17
19
|
private XDGAccountMobileImpl(){
|
|
18
20
|
EngineBridge.GetInstance()
|
|
19
21
|
.Register(ACCOUNT_SERVICE_NAME, ACCOUNT_SERVICE_IMPL);
|
|
22
|
+
EngineBridge.GetInstance()
|
|
23
|
+
.Register(ACCOUNT_SERVICE_NAME_UNITY, ACCOUNT_SERVICE_IMPL_UNITY);
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
private readonly string XDG_ACCOUNT_SERVICE = "XDGLoginService"; //注意要和iOS本地的桥接文件名一样!
|
|
27
|
+
private readonly string XDG_ACCOUNT_SERVICE_UNITY = "XDGLoginServiceUnity"; //注意要和iOS本地的桥接文件名一样!
|
|
23
28
|
private static volatile XDGAccountMobileImpl _instance;
|
|
24
29
|
private static readonly object Locker = new object();
|
|
25
30
|
|
|
@@ -418,6 +423,22 @@ namespace XD.SDK.Account{
|
|
|
418
423
|
callback(success);
|
|
419
424
|
});
|
|
420
425
|
}
|
|
421
|
-
|
|
426
|
+
|
|
427
|
+
public void OpenUserDashboard(XDGRoleInfo roleInfo){
|
|
428
|
+
var dic = new Dictionary<string, object>{
|
|
429
|
+
{"serverId", roleInfo.serverId},
|
|
430
|
+
{"roleId", roleInfo.roleId},
|
|
431
|
+
{"roleName", roleInfo.roleName},
|
|
432
|
+
{"extra", roleInfo.extra}
|
|
433
|
+
};
|
|
434
|
+
var command = new Command.Builder()
|
|
435
|
+
.Service(XDG_ACCOUNT_SERVICE_UNITY)
|
|
436
|
+
.Method("openUserDashboard")
|
|
437
|
+
.Args(dic)
|
|
438
|
+
.Callback(false)
|
|
439
|
+
.OnceTime(true)
|
|
440
|
+
.CommandBuilder();
|
|
441
|
+
EngineBridge.GetInstance().CallHandler(command);
|
|
442
|
+
}
|
|
422
443
|
}
|
|
423
444
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.account",
|
|
3
3
|
"displayName": "XDSDK Account",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.23.0",
|
|
5
5
|
"description": "XDSDK",
|
|
6
6
|
"unity": "2018.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.tds.bootstrap": "3.
|
|
9
|
+
"com.xd.tds.bootstrap": "3.29.4-xd.2"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#if UNITY_ANDROID || UNITY_IOS
|
|
2
|
-
|
|
3
|
-
using System.Runtime.InteropServices;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace XD.SDK.Account.Mobile.Bridge
|
|
7
|
-
{
|
|
8
|
-
public class AccountMobile
|
|
9
|
-
{
|
|
10
|
-
#if UNITY_ANDROID
|
|
11
|
-
private static AndroidJavaClass _androidJavaClass;
|
|
12
|
-
|
|
13
|
-
private static AndroidJavaClass GetInstance()
|
|
14
|
-
{
|
|
15
|
-
if (_androidJavaClass == null)
|
|
16
|
-
{
|
|
17
|
-
_androidJavaClass = new AndroidJavaClass("com.xd.intl.account.XDGAccount");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return _androidJavaClass;
|
|
21
|
-
}
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
public static void OpenUserDashboard(XDGRoleInfo roleInfo)
|
|
25
|
-
{
|
|
26
|
-
#if UNITY_ANDROID
|
|
27
|
-
using (AndroidJavaClass accountBridge = new AndroidJavaClass("com.xd.account.bridge.XDGAccountBridge")) {
|
|
28
|
-
accountBridge.CallStatic("openUserDashboard", roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
|
|
29
|
-
}
|
|
30
|
-
#else
|
|
31
|
-
XDAccountOpenUserDashboard(roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
|
|
32
|
-
#endif
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#if UNITY_IOS
|
|
36
|
-
[DllImport("__Internal")]
|
|
37
|
-
private static extern void XDAccountOpenUserDashboard(string roleId, string roleName, string serverId, string extra);
|
|
38
|
-
#endif
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
#endif
|
package/Mobile/Bridge.meta
DELETED
|
Binary file
|
|
File without changes
|