Instant Messaging (IM) provides a complete set of profile solutions through its user profile hosting capacity. IM’s profile hosting service enables your users to easily set and pull profiles.
By using IM’s profile hosting service, you will be able to:
A profile is a set of data that describes user properties. IM’s profile system supports standard and custom profile fields. Profile fields have the following characteristics:
Profile fields are expressed in key-value format.
Key is of string type, and its name contains only uppercase and lowercase letters, numbers, and underscores.
Value has the following types:
a. An integer of uint32_t type (not supported for custom fields).
b. An integer of uint64_t type (not supported for custom fields).
c. A string of string type (the length of the string cannot exceed 500 bytes.)
d. A buffer of bytes type (the length of the buffer cannot exceed 500 bytes.)
You can configure the read and write permissions for each key. The read and write permissions of profile fields are as follows:
|Permission Name||Permission Type||Notes|
Readable by app
Readable by app admin
|You can select one or more types of read permission.|
Writable by app
Writable by app admin
|You can select one or more types of write permission.|
Currently, IM supports the following standard profile fields:
|Field Name||Type||Description||Push Notification upon Update||Notes|
|Tag_Profile_IM_Nick||string||Nickname||Yes||The maximum length is 500 bytes.|
Gender_Type_Unknown: the gender is not set
|Tag_Profile_IM_BirthDay||uint32||Date of birth||Yes||Recommended format: 20190419|
The maximum length is 16 bytes. Recommended usage:
The app locally defines a set of number-location mappings.
The backend stores four uint32_t numbers.
The first uint32_t denotes the country or region.
The second uint32_t denotes the state or province.
The third uint32_t denotes the city.
The fourth uint32_t denotes the district or county.
|Tag_Profile_IM_SelfSignature||string||Personal signature||Yes||The maximum length is 500 bytes.|
|Tag_Profile_IM_AllowType||string||Approval method for new friend requests||Yes||
AllowType_Type_NeedConfirm: manually approve all new friend requests
AllowType_Type_AllowAny: automatically accept all new friend requests
AllowType_Type_DenyAny: reject all new friend requests
|Tag_Profile_IM_Image||string||URL of the profile photo||Yes||The maximum length is 500 bytes.|
Bit0: set to 0 to receive messages, and set to 1 to block messages
|Tag_Profile_IM_AdminForbidType||string||Admin forbids tagging new friend requests||Yes||
AdminForbid_Type_None: the default value, and sending new friend requests is allowed.
AdminForbid_Type_SendOut: sending new friend requests is forbidden.
|Tag_Profile_IM_Level||uint32||Level||Yes||Generally, a UINT-8 stores the information about one level.
You can divide the values into categories to store level information of multiple roles.
|Tag_Profile_IM_Role||uint32||Role||Yes||Generally, a UINT-8 stores the information about one role.
You can divide the values into categories to store information of multiple roles.
Custom profile fields are the user data set by each app according to its own business needs. By using custom profile fields, an app can add additional data to user profiles and perform read and write operations through existing APIs.
To apply for custom profile fields, the app admin can log in to IM Console and choose App Configuration > Feature Configuration. After the application is submitted, custom profile fields will take effect in 5 minutes.
When applying for custom profile fields, you need to submit the following information for each field:
The rules for naming custom profile fields are as follows: