Skip to content

Commit 14ceb19

Browse files
committed
添加updateMyUserInfo更新当前用户资料
1 parent a16e63d commit 14ceb19

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

android/src/main/java/com/netease/im/RNNeteaseImModule.java

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,28 +1319,19 @@ public void clearMessage(String sessionId, String sessionType, final Promise pro
13191319
}
13201320

13211321
/**
1322-
* 保存用户资料
1322+
* 更新用户资料
13231323
*
1324+
* @param name
13241325
* @param promise
13251326
*/
1326-
// @ReactMethod
1327-
public void updateMyUserInfo(final Promise promise) {//TODO;
1328-
1329-
// final Map<UserInfoFieldEnum, Object> fields = new HashMap<>(1);
1330-
// UserUpdateHelper.update(fields, new RequestCallbackWrapper<Void>() {
1331-
// @Override
1332-
// public void onResult(int code, Void result, Throwable exception) {
1333-
//
1334-
// if (code == ResponseCode.RES_SUCCESS) {
1335-
// LogUtil.i(TAG, "update userInfo success, update fields count=" + fields.size());
1336-
// } else {
1337-
// if (exception != null) {
1338-
// Toast.makeText(IMApplication.getContext(), R.string.user_info_update_failed, Toast.LENGTH_SHORT).show();
1339-
// LogUtil.i(TAG, "update userInfo failed, exception=" + exception.getMessage());
1340-
// }
1341-
// }
1342-
// }
1343-
// });
1327+
@ReactMethod
1328+
public void updateMyUserInfo(String name, final Promise promise) {
1329+
String contactId = LoginService.getInstance().getAccount();
1330+
NimUserInfoCache.getInstance().getUserInfoFromRemote(contactId, new RequestCallbackWrapper<NimUserInfo>() {
1331+
@Override
1332+
public void onResult(int i, NimUserInfo userInfo, Throwable throwable) {
1333+
}
1334+
});
13441335
}
13451336

13461337
/**

0 commit comments

Comments
 (0)