Clears the value of an attribute in the registration.
Syntax
MCReactModule.clearAttribute(key);
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
string |
The name of the attribute whose value must be cleared from the registration. |
Returns
void- No return value.
Example
import { MCReactModule } from "react-native-marketingcloudsdk";
const clearUserAttribute = () => {
try {
MCReactModule.clearAttribute("userType");
console.log("Attribute cleared successfully");
} catch (error) {
console.error("Error clearing attribute:", error);
}
};