注册

ios 集成环信红包,弹出红包界面,怎么把手机号变成昵称??



IMG_1290.PNG


集成环信红包,弹出红包界面,怎么把手机号变成昵称?跪求各位大神
已邀请:
// 要在此处根据userID获得用户昵称,和头像地址
- (RedpacketUserInfo *)profileEntityWith:(NSString *)userId
{
    RedpacketUserInfo *userInfo = [RedpacketUserInfo new];

    UserProfileEntity *profile = [[UserProfileManager sharedInstance] getUserProfileByUsername:userId];
    if (profile) {
        if (profile.nickname && profile.nickname.length > 0) {
            
            userInfo.userNickname = profile.nickname;
            
        } else {
            userInfo.userNickname = userId;
        }
    } else {
        userInfo.userNickname = userId;
    }
    
    userInfo.userAvatar = profile.imageUrl;
    userInfo.userId = userId;
    return userInfo;
}
在代码中将昵称换成自己服务器的昵称即可

xzw

这个方法不是你得传过来个userId么,那要怎么将自己的换成自己服务器的昵称??能不能说的再详细点,非常感谢。

要回复问题请先登录注册