Add custom tags and callbacks to Android apps

The custom tags and callback code can be used to create your preferred user segment and callbacks apart from the existing ones present on the Truepush App dashboard.

After the code integration is complete using the guide here. Follow the below steps to add customer tags and callbacks-


Implement a class with TruePushCallBacks interface and Override the following methods to receive callbacks about Tags registration,

1.1 onSuccess(String successResponse)

1.2 onFailure(String errorResponse)

1.3 onNotificationRecived(String response, String fireEvent)

onSuccess(String successResponse)
onSuccess(String successResponse)
onNotificationRecived(String response, String fireEvent)
onNotificationRecived(String response, String fireEvent)
onFailure(String errorResponse)
onFailure(String errorResponse)


2.1 Prepare the tags you want to add using the JSON code given in the code integration page of the dashboard:

2.2 You can add any number of tags in the form of Object and place them in an Array in the JSON code.


Finally, you will have to add the tags using the code addTags()to add this information to the custom tag that will create a custom segment in the Truepush dashboard.

addTags() code
addTags() code

Hence, your custom segments and callbacks are added on your Truepush dashboard.
Also, read:
How to create a new platform for the existing project
How to generate a firebase server key

Follow us on our Social Media pages.

Review us on TrustRadius.


Image source- Freepik
Credits- <a href=””>Infographic vector created by stories –</a>