Override Notification Clicks - Deprecated in v2.1.1

To override the click actions on notifications rendered by Blueshift Android SDK, follow the steps given below.

Override BlueshiftNotificationEventsService

public class YourServiceName extends BlueshiftNotificationEventsService {

@Override
public void openApp(Context context, Bundle bundle) {
/*
* This method is called whenever an action to open app
* is fired on a notification click. This is the default
* action taken on notification clicks when no category
* is provided.
*
* Override this to take your own action on this.*/
}

@Override
public void addToCart(Context context, Bundle bundle) {
/*
* This method is called when 'Buy' button is clicked
* from a notification that has category 'buy'.
*
* Override this to take your own action on this.*/
}

@Override
public void displayProductPage(Context context, Bundle bundle) {
/*
* This method is called when 'View' button is clicked
* from a notification that has category 'buy'.
*
* Override this to take your own action on this.*/
}

@Override
public void displayCartPage(Context context, Bundle bundle) {
/*
* This method is called when notification with category
* 'view_cart' is being clicked.
*
* Override this to take your own action on this.*/
}

@Override
public void displayOfferDisplayPage(Context context, Bundle bundle) {
/*
* This method is called when notification with category
* 'promotion' is being clicked.
*
* Override this to take your own action on this.*/
}
}

Update AndroidManifest.xml

<service android:name="your.package.name.YourServiceName">
    <intent-filter>
        <action android:name="com.blueshift.NOTIFICATION_CLICK_EVENT" />
    </intent-filter>
</service>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request