Last Updated on : 2022-02-17 06:49:38download
TuyaCommunityHouseMemberService
provides the API methods to manage house members. For example, add, transfer, query, or delete members.
Adds a member to a specified house.
API description
- (void)addMemberWithCommunityId:(NSString *)communityId
roomId:(NSString *)roomId
realName:(NSString *)realName
sex:(TuyaCommunityGenderType)sex
phoneNumber:(NSString *)phoneNumber
userType:(NSString *)userType
role:(TuyaCommunityMemberRole)role
expireTime:(NSString * _Nullable)expireTime
success:(void(^)(NSString *roomUserId))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
roomId | The room ID. |
realName | The real name of the member. |
sex | The gender of the member. Valid values:
|
phoneNumber | The mobile phone number. |
userType | The type of member. You can get the value from the returned list of user types. |
role | The role of the member. Valid values:
|
expireTime | The expiration time. This parameter is optional and specifies the time when a lease expires for a tenant user. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service addMemberWithCommunityId:@"xxx"
roomId:@"xxx"
realName:@"xxx"
sex:TuyaCommunityGenderTypeMale
phoneNumber:@"xxx"
userType:@"xxx"
role:TuyaCommunityMemberRoleMember
expireTime:nil
success:^(NSString * _Nonnull roomUserId) {
// success handler
}
failure:^(NSError * _Nonnull error) {
// failure handler
}];
Returns the details of a member in a house.
API description
- (void)getMemberDetailWithCommunityId:(NSString *)communityId
roomUserId:(NSString *)roomUserId
success:(void(^)(TuyaCommunityMemberModel *result))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
roomUserId | The ID of the mapping between a house and a user. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMemberDetailWithCommunityId:@"xxx"
roomUserId:@"xxx"
success:^(TuyaCommunityMemberModel * _Nonnull result) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
Returns the details of a member that is transferred out of a house.
API description
- (void)getMoveOutMemberDetailWithCommunityId:(NSString *)communityId
roomUserId:(NSString *)roomUserId
success:(void(^)(TuyaCommunityMemberModel *result))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
roomUserId | The ID of the mapping between a house and a user. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMoveOutMemberDetailWithCommunityId:@"xxx"
roomUserId:@"xxx"
success:^(TuyaCommunityMemberModel * _Nonnull result) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)getMemberListWithCommunityId:(NSString *)communityId
houseId:(long long)houseId
success:(void(^)(NSArray<TuyaCommunityMemberModel *>*list))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
houseId | The house ID. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMemberListWithCommunityId:@"xxx"
houseId:@"xxx"
success:^(NSArray<TuyaCommunityMemberModel *> * _Nonnull list) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)getMemberListWithCommunityId:(NSString *)communityId
houseId:(long long)houseId
success:(void(^)(NSArray<TuyaCommunityMemberModel *>*list))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
houseId | The house ID. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMoveOutMemberListWithCommunityId:@"xxx"
houseId:@"xxx"
success:^(NSArray<TuyaCommunityMemberModel *> * _Nonnull list) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)getMemberTypeListWithRoomId:(NSString *)roomId
success:(void(^)(NSArray<TuyaCommunityMemberTypeModel *>*list))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
roomId | The room ID. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMemberTypeListWithroomId:@"xxx"
success:^(NSArray<TuyaCommunityMemberTypeModel *> * _Nonnull list) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)auditMemberWithCommunityId:(NSString *)communityId
roomUserId:(NSString *)roomUserId
audit:(TuyaCommunityMemberAuditStatus)audit
role:(TuyaCommunityMemberRole)role
success:(void(^)(void))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
roomUserId | The ID of the mapping between a house and a user. |
audit | The reviewing status. Valid values:
|
role | The role of the house member. Valid values:
|
success | The success callback. |
failure | The failure callback. |
Example
[self.service getMemberTypeListWithroomId:@"xxx"
success:^(NSArray<TuyaCommunityMemberTypeModel *> * _Nonnull list) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)getUserCertificationInfoWithSuccess:(void(^)(TuyaCommunityUserCertificationInfoModel *result))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | The success callback. |
failure | The failure callback. |
Example
[self.service getUserCertificationInfoWithSuccess:^(TuyaCommunityUserCertificationInfoModel * _Nonnull result) {
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
Things to note
This API method is used to verify a user’s identity and mobile phone number in a community. It is required when the user requests to add a house to the community. The house can be added only after the user identity is verified.
API description
- (void)verifyUserInfoWithRealName:(NSString *)realName
sex:(TuyaCommunityGenderType)sex
idCard:(NSString * _Nullable)idCard
success:(void(^)(void))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
realName | The real name of the member. |
sex | The gender of the member. |
idCard | The ID card number. This parameter is optional. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service verifyUserInfoWithRealName:@"xxx"
sex:TuyaCommunityGenderTypeMale
idCard:nil
success:^{
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
addHouseWithName:communityId:roomId:userType:expireTime:success:failure:
in the class TuyaCommunityHouseManager
can be called to add a house.Updates the role of a member in a house. In most cases, this API method is called when the member is transferred out of the house.
API description
- (void)updateMemberRoleWithMemberId:(long long)memberId
role:(TuyaCommunityMemberRole)role
success:(void(^)(void))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
memberId | The member ID. |
role | The role of the house member. Valid values:
|
success | The success callback. |
failure | The failure callback. |
Example
[self.service updateMemberRoleWithMemberId:0
role:TuyaCommunityMemberRoleMember
success:^{
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
TuyaCommunityMemberRole
can be sorted in ascending order of permission levels: Custom
< Member
< Admin
< Owner
. Members can manage those with the same or lower levels of permissions.TuyaCommunityMemberRoleOwner
specifies a house owner that is granted the highest level of permissions. Only the owner can transfer other members out of the same house.Transfers a member other than an owner out of a house
API description
- (void)moveOutMemberWithCommunityId:(NSString *)communityId
roomUserId:(NSString *)roomUserId
success:(void(^)(void))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
roomUserId | The ID of the mapping between a house and a user. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service moveOutMemberWithCommunityId:@"xxx"
roomUserId:@"xxx"
success:^{
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
API description
- (void)deleteMemberWithCommunityId:(NSString *)communityId
houseId:(long long)houseId
roomUserId:(NSString *)roomUserId
success:(void(^)(void))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
communityId | The community ID. |
houseId | The house ID. |
roomUserId | The ID of the mapping between a house and a user. |
success | The success callback. |
failure | The failure callback. |
Example
[self.service deleteMemberWithCommunityId:@"xxx"
houseId:0
roomUserId:@"xxx"
success:^{
// success handler
} failure:^(NSError * _Nonnull error) {
// failure handler
}];
Property | Type | Description |
---|---|---|
memberId | long long | The member ID. |
headPic | NSString | The avatar of a member. |
sex | TuyaCommunityGenderType | The gender of a member. Valid values:
|
nickName | NSString | The nickname. |
realName | NSString | The real name of a member. |
account | NSString | The user. |
roomUserId | NSString | The ID of the mapping between a house and a user. |
houseId | long long | The house ID. |
userTypeName | NSString | The type of member, such as an owner. |
userTypeCode | NSString | The user type code of the current user. Valid values:
|
role | TuyaCommunityMemberRole | The role of the member. Valid values:
|
audit | TuyaCommunityMemberAuditStatus | The reviewing status of a member. Valid values:
|
dealStatus | TuyaCommunityMemberInviteStatus | The invitation status of a member. |
countryCode | NSString | The country code. |
activeStatus | BOOL | The activation status. |
uploaded | BOOL | Indicates whether a member has uploaded the biometric identity. |
mobile | NSString | The mobile phone number. |
uid | NSString | The user ID. |
applySource | TuyaCommunityMemberApplySourceType | The type of channel through which a member sends a request. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback