clearAttribute

Clears the value of an attribute in the registration.

Syntax 

1MCReactModule.clearAttribute(key);

Parameters 

ParameterTypeDescription
keystringThe name of the attribute whose value must be cleared from the registration.

Returns 

  • void - No return value.

Example 

1import { MCReactModule } from "react-native-marketingcloudsdk";
2
3const clearUserAttribute = () => {
4  try {
5    MCReactModule.clearAttribute("userType");
6    console.log("Attribute cleared successfully");
7  } catch (error) {
8    console.error("Error clearing attribute:", error);
9  }
10};

See Also 

Related Methods