getMessageCode
Gets the message code for this push notification.
The message code is a unique identifier extracted from the push hash. It can be used for tracking and identifying specific messages in your analytics or logging systems. Example:
protected void onMessageOpened(PushMessage message) {
String messageCode = message.getMessageCode();
long campaignId = message.getCampaignId();
// Track in analytics with detailed identifiers
analytics.trackEvent("notification_opened", new HashMap<String, Object>() {{
put("message_code", messageCode);
put("campaign_id", campaignId);
put("title", message.getHeader());
}});
Log.d("App", "Opened message: " + messageCode);
}
Content copied to clipboard
Return
message code string, or null if not available