handleNotificationCanceled
Internal method that handles notification dismissal events.
This is a final method called by the SDK when a user swipes away or dismisses a notification from the notification center. It delegates to onMessageCanceled for custom handling.
You should override onMessageCanceled instead of calling this method directly. Example:
protected void onMessageCanceled(PushMessage message) {
// Track dismissal in analytics
String customData = message.getCustomData();
if (customData != null) {
try {
String messageId = new JSONObject(customData).optString("message_id", null);
Analytics.track("notification_dismissed", messageId);
} catch (JSONException e) {
Log.e("App", "Failed to parse custom data", e);
}
}
// Update unread count
decrementUnreadNotifications();
}
Content copied to clipboard
Parameters
pushBundle
push notification payload as Bundle containing all notification data