Push Message Payload Mapping

The push server provides a convenient wrapper on top of the push messages sent to various platforms (APNS, FCM, HMS). This chapter describes what fields of the abstract push message are mapped to particular fields of APNS, FCM, or HMS payload.

Abstract Push Message Object

Abstract push message payload is represented using this object:

public class PushMessageBody {

    private String title;
    private String titleLocKey;
    private String[] titleLocArgs;
    private String body;
    private String bodyLocKey;
    private String[] bodyLocArgs;
    private Integer badge;
    private String sound;
    private String icon;
    private String category;
    private String collapseKey;
    private Date validUntil;
    private Map<String, Object> extras;

}

APNS Mapping

Attributes of the abstract push message object are mapped to APNS payload in following way:

Abstract Message Attributes APNS Mapped Attributes
title aps.alert.title
titleLocKey aps.alert.title-loc-key
titleLocArgs aps.alert.title-loc-args
body aps.alert.body
bodyLocKey aps.alert.loc-key
bodyLocArgs aps.alert.loc-args
badge aps.badge
category aps.category
sound aps.sound
icon ignored
extras [key:value] custom data
collapseKey aps.thread-id
validUntil Message expiration time on APNS servers (technical attribute), mapped to apns-expiration HTTP header.

For the documentation of the APNS payload reference, please read the official Apple documentation:

Silent Messages

In case a push message is marked with the silent flag, we add content-available = 1 key to the aps payload.

FCM Mapping

Attributes of the abstract push message object are mapped to FCM payload in following way:

Abstract Message Attribute FCM Mapped Attributes
title notification.title
titleLocKey notification.title_loc_key
titleLocArgs notification.title_loc_args
body notification.body
bodyLocKey notification.body_loc_key
bodyLocArgs notification.body_loc_args
badge ignored
category notification.tag
sound notification.sound
icon notification.icon
collapseKey collapse_key
validUntil ignored
extras data

For the documentation of the FCM payload reference, please read the official Google documentation:

Silent Messages

In case a push message is marked with the silent flag, we do not add attributes that trigger visible push notifications (attributes with notification.* path), even if they are present in the abstract push message object.

HMS Mapping

Attributes of the abstract push message object are mapped to HMS payload in following way:

Abstract Message Attribute HMS Mapped Attributes Type Description
title notification.title    
titleLocKey notification.title_loc_key    
titleLocArgs notification.title_loc_args    
body notification.body    
bodyLocKey notification.body_loc_key    
bodyLocArgs notification.body_loc_args    
badge ignored    
category notification.tag    
sound notification.sound    
icon notification.icon    
collapseKey collapse_key String containing Integer Mode for the Push Kit server to cache messages sent to an offline device. -1 (default): All messages are cached.
validUntil ignored    
extras data    

For details, see Huawei documentation.

Last updated on Feb 13, 2024 (11:34) Edit on Github Send Feedback
Search

develop

PowerAuth Push Server