Authentication
Update logged in user's details
Update some of the logged-in user's user details, such as displayName, imageUrl, metadata, and so on. Use the updateUserDetail
method as below (Remove the fields from the userDetails object that aren't required.)
let userDetails = {
'displayName': '<New Name>',
'imageLink': '<new-image-url>',
'email': '<New-Email>',
'contactNumber': '<New-Contact-Number>'
'metadata': {
'objKey1' : 'objValue1',
'objKey2' : 'objValue2'
}
};
KommunicateCapacitorPlugin.updateUserDetails(userDetails).then((res) => {
console.log("Update user details success : " + JSON.stringify(res))
}).catch((error) => {
console.log("Update user details error : " + error)
});
Note: userId is a unique identifier of a kmUser object. It cannot be updated.
Logout
Call the logout method to logout the user from kommunicate. Use the method as below:
KommunicateCapacitorPlugin.logout().then((res) => {
console.log("Logout success : " + JSON.stringify(res))
}).catch((error) => {
console.log("Logout error : " + error)
});