User Meta Data

Registration with MetaData#

To register a user with providing IdentifierMetaData, you can utilise below method.

Mirrorfly.login(userIdentifier: userIdentifier,
fcmToken: token,
isForceRegister: isForceRegister,
identifierMetaData: identifierMetaData,
flyCallback: (FlyResponse response) {
if(response.isSuccess && response.hasData){
// you will get the user registration response
var userData = registerModelFromJson(value);
}
});
ArgumentTypeDescription
userIdentifierStringA unique Id to Register the User. We accept only the AlphaNumeric String
tokenStringA registration token that is generated by FCM Plugin for the user's app instance to send message for free
identifierMetaDataList<IdentifierMetaData>list of key - value pair of metadata object. Maximum size is 3
isForceRegisterBooleandefault value true, provide true to force the logout of the old session if the login user has reached the maximum no of multi-sessions or provide false to allow registration till the maximum no of multi-sessions
flyCallbackFlyResponsecallback to observe the action status

Get User List with MetaData#

To retrieve all registered users with MetaData use below method. User list can also be retrived based on search key word, also this method supports pagination. This function will return the total number of pages.

Mirrorfly.getUserList(page: PAGE_NUMBER, search: SEARCH_TERM, perPageResultSize: PER_PAGE_RESULT_SIZE,
metaDataUserList: META_DATA_USER_LIST,
flyCallback: (FlyResponse response){
if (response.isSuccess && response.hasData) {
var list = userListFromJson(response.data);
//User list fetched. Update the UI
} else {
//Get user list failed print throwable to find the details
}
});

Refer this doc to know more about Profile Details Class

ArgumentTypeDescription
PAGE_NUMBERintPage number of user list default value 1
PER_PAGE_RESULT_SIZEintNumber of users per page default value 20
SEARCH_TERMStringtext characters for which search has to happen default value empty
META_DATA_USER_LISTList<IdentifierMetaData>model class which filters the results by metadata default value is empty
flyCallbackFlyResponsecallback to observe the action status

Get MetaData of user#

If you want to get MetaData value of user, you can utilise the below method.

Mirrorfly.getMetaData(flyCallback: (FlyResponse response){
if(response.isSuccess && response.hasData){
// you will get the user MetaData response
var list = identifierMetaDataFromJson(response.data);
}
});
ArgumentTypeDescription
flyCallbackFlyResponsecallback to observe the action status

Update MetaData of user#

If you want to update MetaData value of user, you can utilise the below method.

Mirrorfly.updateMetaData(identifierMetaDataList: IDENTIFIER_METADATA_USERLIST, flyCallback: (FlyResponse response){
if(response.isSuccess && response.hasData){
// you will get the user IdentifierMetaData List response
}
});
ArgumentTypeDescription
META_DATA_USER_LISTList<IdentifierMetaData>model class which filters the results by metadata default value is empty
flyCallbackFlyResponsecallback to observe the action status