Add custom data
In many situations you may want to attach custom data to feedback items in order to better understand the context. You can add custom data incrementally or all at once. Any simple dictionary can be attached.
Java
Gleap.getInstance().setCustomData("email", "[email protected]");Append custom data
If you want to attach custom data incrementally, you can do so with the attachCustomData method. The new data is merged into the existing custom data; keys that already exist are overwritten.
Merging needs SDK v19.0.0 or newer. Before,
attachCustomData replaced all existing custom data.Java
JSONObject jsonObject = new JSONObject();
Gleap.getInstance().attachCustomData(jsonObject);Remove custom data
Remove custom data key value pairs by calling the following method.
Java
Gleap.getInstance().removeCustomDataForKey("email");Clear all custom data
It's possible to clear all attached custom data by calling the following method.
Java
Gleap.getInstance().clearCustomData();
