Push Listener

In-App Marketing will be shutting down November 1st, 2018. API calls will be removed in Tune Android & iOS SDKs v6.0.0. Customers are required to remove all code references to prevent service disruption. Please contact your Customer Success Manager with additional questions.

On Android, the TUNE SDK provides a TunePushListener interface that can be implemented to access extraPushPayload from a Tune Push Message and decide if a notification should be displayed.


Start by creating a class that implements a TunePushListener.

public class MyPushListener implements TunePushListener {
    public boolean onReceive(boolean isSilentPush, JSONObject extraPushPayload) {
        // Add logic to determine whether or not you want the push to be displayed.
        // Return true to display a push, false otherwise. If you return true here, but it's a silent push, a notification does not display.
        return true;

Then, create an object of the listener you implemented. For example,

MyPushListener listener = new MyPushListener();

Finally, tell the TUNE SDK to use the push listener you've created. This call should go after Tune.init:


You're set! Any TUNE push notifications you receive in your app will be passed through the `onReceive` of this listener to access the extraPushPayload and decide if the push should be displayed.

No Comments

Leave a reply