com.xd.sdk.account 6.22.2 → 6.22.3

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.
@@ -21,18 +21,20 @@ namespace XD.SDK.Account.Mobile.Bridge
21
21
  }
22
22
  #endif
23
23
 
24
- public static void OpenUserDashboard()
24
+ public static void OpenUserDashboard(XDGRoleInfo roleInfo)
25
25
  {
26
26
  #if UNITY_ANDROID
27
- GetInstance().CallStatic("openUserDashboard");
27
+ using (AndroidJavaClass accountBridge = new AndroidJavaClass("com.xd.account.bridge.XDGAccountBridge")) {
28
+ accountBridge.CallStatic("openUserDashboard", roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
29
+ }
28
30
  #else
29
- XDAccountOpenUserDashboard();
31
+ XDAccountOpenUserDashboard(roleInfo.roleId, roleInfo.roleName, roleInfo.serverId, roleInfo.extra);
30
32
  #endif
31
33
  }
32
34
 
33
35
  #if UNITY_IOS
34
36
  [DllImport("__Internal")]
35
- private static extern void XDAccountOpenUserDashboard();
37
+ private static extern void XDAccountOpenUserDashboard(string roleId, string roleName, string serverId, string extra);
36
38
  #endif
37
39
  }
38
40
  }
@@ -1,8 +1,13 @@
1
1
  package com.xd.account.bridge;
2
2
 
3
+ import android.os.Handler;
4
+ import android.os.Looper;
5
+
3
6
  import com.xd.intl.common.net.CommonParameterManager;
4
7
  import com.xd.intl.common.bridge.BridgeUtil;
5
8
  import com.xd.intl.common.global.GlobalUserStore;
9
+ import com.xd.intl.account.XDGAccount;
10
+ import com.xd.intl.account.v2.entity.RoleInfo;
6
11
 
7
12
  public class XDGAccountBridge {
8
13
  public static String getAuthorization(String url, String method, long timestamp) {
@@ -12,4 +17,20 @@ public class XDGAccountBridge {
12
17
  public static String getCurrentUser() {
13
18
  return BridgeUtil.convertUserJsonString4Bridge(GlobalUserStore.INSTANCE.getCurrentXDUser());
14
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
+ }
15
36
  }
@@ -26,6 +26,19 @@ const char*XDAccountBridgeGetUser() {
26
26
  return [userDic.tdsglobal_jsonString UTF8String];
27
27
  }
28
28
 
29
- void XDAccountOpenUserDashboard() {
30
- [XDGAccount openUserDashboard];
29
+ void XDAccountOpenUserDashboard(const char* roleId, const char* roleName, const char* serverId, const char* extra) {
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];
31
44
  }
@@ -128,9 +128,9 @@ namespace XD.SDK.Account{
128
128
  XDGAccountMobileImpl.GetInstance().BindByType(loginType, (b, error)=> callback(b, error as XDGError));
129
129
  }
130
130
 
131
- public void OpenUserDashboard()
131
+ public void OpenUserDashboard(XDGRoleInfo roleInfo)
132
132
  {
133
- AccountMobile.OpenUserDashboard();
133
+ AccountMobile.OpenUserDashboard(roleInfo);
134
134
  }
135
135
 
136
136
  #endregion
@@ -21,3 +21,4 @@ FOUNDATION_EXPORT const unsigned char XDAccountSDKVersionString[];
21
21
  #import <XDAccountSDK/XDGLoginService.h>
22
22
  #import <XDAccountSDK/XDGAccountVersion.h>
23
23
  #import <XDAccountSDK/XDGLogger+Account.h>
24
+ #import <XDAccountSDK/XDGRoleInfo.h>
@@ -2,6 +2,7 @@
2
2
  #import <Foundation/Foundation.h>
3
3
  #import <XDCommonSDK/XDCommonSDK.h>
4
4
  #import <XDAccountSDK/XDGLoginEntriesConfig.h>
5
+ #import <XDAccountSDK/XDGRoleInfo.h>
5
6
 
6
7
  NS_ASSUME_NONNULL_BEGIN
7
8
 
@@ -59,7 +60,8 @@ typedef void (^XDGUserStatusChangeCallback)(XDGUserStateChangeCode userStateChan
59
60
  + (void)openUserCenter;
60
61
 
61
62
  /// 打开个人信息页
62
- + (void)openUserDashboard;
63
+ /// @param roleInfo 角色信息
64
+ + (void)openUserDashboardWithInfo:(XDGRoleInfo *_Nullable)roleInfo;
63
65
 
64
66
  /// 打开注销页面
65
67
  + (void)accountCancellation;
@@ -4,5 +4,5 @@
4
4
  //
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
- #define XDGAccount_VERSION @"6.22.2"
8
- // HASH cb5e085
7
+ #define XDGAccount_VERSION @"6.22.3"
8
+ // HASH 8f76a97
@@ -0,0 +1,22 @@
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
@@ -38,7 +38,7 @@ namespace XD.SDK.Account{
38
38
  //除了 Default 和 Guest
39
39
  void BindByType(LoginType loginType, Action<bool, XDGError> callback);
40
40
 
41
- void OpenUserDashboard();
41
+ void OpenUserDashboard(XDGRoleInfo roleInfo);
42
42
 
43
43
  }
44
44
  }
@@ -89,9 +89,9 @@ namespace XD.SDK.Account{
89
89
  platformWrapper.BindByType(loginType, callback);
90
90
  }
91
91
 
92
- public static void OpenUserDashboard()
92
+ public static void OpenUserDashboard(XDGRoleInfo roleInfo)
93
93
  {
94
- platformWrapper.OpenUserDashboard();
94
+ platformWrapper.OpenUserDashboard(roleInfo);
95
95
  }
96
96
 
97
97
  public static string GetLoginTypeString(LoginType loginType)
@@ -0,0 +1,24 @@
1
+ namespace XD.SDK.Account
2
+ {
3
+ public class XDGRoleInfo
4
+ {
5
+ /// <summary>
6
+ /// Game Role ID. required
7
+ /// </summary>
8
+ public string roleId;
9
+ /// <summary>
10
+ /// Game Role Name. required
11
+ /// </summary>
12
+ public string roleName;
13
+
14
+ /// <summary>
15
+ /// Game Server ID. required
16
+ /// </summary>
17
+ public string serverId;
18
+
19
+ /// <summary>
20
+ /// Extra information. optional
21
+ /// </summary>
22
+ public string extra;
23
+ }
24
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: ac5b9822d70b4036946f13b047ce3a35
3
+ timeCreated: 1727589306
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "com.xd.sdk.account",
3
3
  "displayName": "XDSDK Account",
4
- "version": "6.22.2",
4
+ "version": "6.22.3",
5
5
  "description": "XDSDK",
6
6
  "unity": "2018.3",
7
7
  "license": "MIT",