audienceManagerGetProfileAttributes

❗️

Deprecated

This method is no longer recommended. Audience Manager is no longer available in the latest product version.

The audienceManagerGetProfileAttributes() method returns profile attributes. You can only access the attributes that have been granted access.

Syntax

tracker.audienceManagerGetProfileAttributes(object : OnGetProfileAttributes {
    override fun onAttributesReceived(attributes: Map<String, String>) {
        // handle result
    }

    override fun onError(errorData: String) {
        val error = if (errorData.isEmpty()) "Network error" else errorData
        // handle error
    }
})
getTracker().audienceManagerGetProfileAttributes(new Tracker.OnGetProfileAttributes() {
    @Override
    public void onAttributesReceived(Map<String, String> attributes) {
      // handle result
    }

    @Override
    public void onError(String errorData) {
      errorData = TextUtils.isEmpty(errorData) ? "Network error": errorData;
      // handle error
    }
});

Parameters

OnGetProfileAttributes () (required)

The callback to handle a request result. The call is asynchronous. It has two methods void onAttributesReceived(Map<String, String> attributes) and void onError(String errorData).

attributes (output)

The dictionary of key-value pairs. Key: attribute name. Value: attribute value.

errorData (output)

The error string. If an error occurs, only this method will be called.

Examples

To get profile attributes:

tracker.audienceManagerGetProfileAttributes(object : OnGetProfileAttributes {
    override fun onAttributesReceived(attributes: Map<String, String>) {
        // handle result
    }

    override fun onError(errorData: String) {
        val error = if (errorData.isEmpty()) "Network error" else errorData
        // handle error
    }
})
getTracker().audienceManagerGetProfileAttributes(new Tracker.OnGetProfileAttributes() {
    @Override
    public void onAttributesReceived(Map<String, String> attributes) {
      // handle result
    }

    @Override
    public void onError(String errorData) {
      errorData = TextUtils.isEmpty(errorData) ? "Network error": errorData;
      // handle error
    }
});

Notes

Related methods