setUserAttribute

open fun setUserAttribute(@NonNull userAttribute: String, @NonNull attributeValue: String): MoEHelper

Set an user attribute. This can be used to segment users on MoEngage platform.

Return

MoEHelper instance

Parameters

userAttribute

The user attribute name which needs to be added. This field cannot be null

attributeValue

The value associated with the specified user attribute


open fun setUserAttribute(@NonNull userAttribute: String, attributeValue: Int): MoEHelper
open fun setUserAttribute(@NonNull userAttribute: String, attributeValue: Boolean): MoEHelper
open fun setUserAttribute(@NonNull userAttribute: String, attributeValue: Double): MoEHelper
open fun setUserAttribute(@NonNull userAttribute: String, attributeValue: Float): MoEHelper
open fun setUserAttribute(@NonNull userAttribute: String, attributeValue: Long): MoEHelper

Set a user attribute for the current user

Return

MoEHelper instance

Parameters

userAttribute

The attribute which needs to be set

attributeValue

The attribute value corresponding to the userAttribute


open fun setUserAttribute(@NonNull attributeMap: Map<String, Any>): MoEHelper

Set the user attributes with the attributes specified in the HashMap

Return

MoEHelper instance

Parameters

attributeMap

The attribute map which needs to be set for the user


open fun setUserAttribute(@NonNull name: String, @NonNull value: Date): MoEHelper

Set a date user attribute for the current user.

Return

MoEHelper instance

Parameters

name

user attribute name.

value

user attribute value.


open fun setUserAttribute(@NonNull name: String, @NonNull date: String, dateFormat: String): MoEHelper
open fun setUserAttribute(@NonNull name: String, @NonNull location: Location): MoEHelper
open fun setUserAttribute(@NonNull name: String, @NonNull location: GeoLocation): MoEHelper