Providers: push message structure
Altcraft Platform supports the following services for sending mobile push messages:
- Google Firebase Cloud Messaging — for Android and iOS apps
- Apple Push Notification Service — for iOS apps only
- Yandex.AppMetrica — for Android and iOS apps
- Huawei Mobile Services — for Android and iOS apps
- RuStore — for Android apps
Connecting the corresponding SDKs in the app is required.
Yandex.AppMetrica uses Google Firebase SDK for delivery. You will need to install it in your app.
Integration with Yandex.AppMetrica is available in Altcraft Platform for importing user profiles, registering their actions and associated value (cost).
You need to verify that the app supports the Altcraft Platform push notification structure. If the format is not supported, Altcraft can adjust the message structure from its side.
Push message format
Android Firebase
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"message": {
"token": "{{.SubscriptionID}}",
"android": {
"priority": "{{.Priority}}",
"ttl": {{.TTL}},
"data": {
"_ac_push": "Altcraft",
"_uid": "{{.UID}}",
"_launch_id": "{{.LaunchID}}",
"_title": "{{.Title}}",
"_provider": "{{.Provider}}",
"_body": "{{.Body}}",
"_icon": "{{.Icon}}",
"_click_action": "{{.ClickURL}}",
"_color": "{{.ImageBackgroundColor}}",
"_image": "{{.Image}}",
"_vibration": "{{.Vibration}}",
"_soundless": "{{.Soundless}}",
"_hub_link": "{\"open\": \"{{.URLOpenEvent}}\", \"ack\": \"{{.URLDelivEvent}}\"}",
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
}
}
}
}
uid — internal send ID, unique for each message.
launch_id — internal send ID, unique within the mailing.
iOS Firebase
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"message": {
"token": "{{.SubscriptionID}}",
"apns": {
"headers": {
"apns-expiration": "{{.TTL}}"
},
"payload": {
"aps": {
"category": "Altcraft",
"sound": {{.Sound}},
"mutable-content": 1,
"alert": {
"title": "{{.Title}}",
"subtitle": "{{.SubTitle}}",
"body": "{{.Body}}"
}
},
"_uid": "{{.UID}}",
"_provider": "{{.Provider}}",
"_launch_id": "{{.LaunchID}}",
"_ac_push": "Altcraft",
"_click-url": "{{.ClickURL}}",
"_media": "{{.Media}}",
"_soundless": "{{.Soundless}}",
"_hub_link": "{\"open\": \"{{.URLOpenEvent}}\", \"ack\": \"{{.URLDelivEvent}}\"}",
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
}
}
}
}
uid — internal send ID, unique for each message.
launch_id — internal send ID, unique within the mailing.
iOS APNS
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"aps": {
"category": "Altcraft",
"mutable-content": 1,
"sound": {{.Sound}},
"alert": {
"title": "{{.Title}}",
"subtitle": "{{.SubTitle}}",
"body": "{{.Body}}"
}
},
"_ac_push": "Altcraft",
"_click-url": "{{.ClickURL}}",
"_soundless": "{{.Soundless}}",
"_media": "{{.Media}}",
"_uid": "{{.UID}}",
"_provider": "{{.Provider}}",
"_hub_link": {
"open": "{{.URLOpenEvent}}",
"ack": "{{.URLDelivEvent}}"
},
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
}
AppMetrica iOS
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"push_batch_request": {
"group_id": 97737,
"tag": "tag",
"batch": [
{
"messages": {
"iOS": {
"silent": true/false,
"content": {
"title": "Title",
"text": "Body",
"badge": 0-999,
"expiration": 0,
"data": "{\"hub_link\":{\"ack\":\"URLDelivEvent\",\"open\":\"URLOpenEvent\"},\"icon\":\"Icon\",\"media\":\"Media\"}"
},
"open_action": {
"url": "URL",
"deeplink": "Deeplink"
}
}
},
"devices": [
{
"id_values": ["SubscriptionID"],
"id_type": "ios_push_token"
}
]
}
]
}
}
AppMetrica Android
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"push_batch_request": {
"group_id": 97737,
"tag": "tag",
"batch": [
{
"messages": {
"android": {
"silent": true/false,
"content": {
"title": "Title",
"text": "Body",
"time_to_live": 0,
"image": "Icon",
"icon_background": "IconBackground",
"banner": "Banner",
"led_color": "LEDColor",
"data": "{\"hub_link\":{\"ack\":\"URLDelivEvent\",\"open\":\"URLOpenEvent\"}}"
},
"open_action": {
"url": "URL",
"deeplink": "Deeplink"
}
}
},
"devices": [
{
"id_values": ["SubscriptionID"],
"id_type": "google_aid"
}
]
}
]
}
}
HMS Android
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"message": {
"token": ["{{.SubscriptionID}}"],
"data": {
"_ac_push": "Altcraft",
"_title": "{{.Title}}",
"_uid": "{{.UID}}",
"_provider": "{{.Provider}}",
"_body": "{{.Body}}",
"_launch_id": "{{.LaunchID}}",
"_vibration": "{{.Vibration}}",
"_soundless": "{{.Soundless}}",
"_hub_link": "{\"open\": \"{{.URLOpenEvent}}\", \"ack\": \"{{.URLDelivEvent}}\"}",
"_icon": "{{.Icon}}",
"_click_action": "{{.ClickURL}}",
"_color": "{{.ImageBackgroundColor}}",
"_image": "{{.Image}}",
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
},
"android": {
"urgency": "HIGH",
"ttl": {{.TTL}}
}
}
}
HMS iOS
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"message": {
"token": ["{{.SubscriptionID}}"],
"apns": {
"headers": {
"apns-expiration": "{{.TTL}}"
},
"payload": {
"aps": {
"category": "Altcraft",
"mutable-content": 1,
"sound": {{.Sound}},
"alert": {
"title": "{{.Title}}",
"subtitle": "{{.SubTitle}}",
"body": "{{.Body}}"
}
},
"_ac_push": "Altcraft",
"_provider": "{{.Provider}}",
"_click-url": "{{.ClickURL}}",
"_soundless": "{{.Soundless}}",
"_uid": "{{.UID}}",
"_media": "{{.Media}}",
"_hub_link": {
"open": "{{.URLOpenEvent}}",
"ack": "{{.URLDelivEvent}}"
},
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
},
"hms_options": {
"target_user_type": 1
}
}
}
}
RuStore Android
It's possible to edit the JSON object (on request).
Adding additional data to the data object is supported. This can be done for each sending individually in the Altcraft Platform message settings.
{
"message": {
"token": "{{.SubscriptionID}}",
"data": {
"_ac_push": "Altcraft",
"_title": "{{.Title}}",
"_uid": "{{.UID}}",
"_provider": "{{.Provider}}",
"_body": "{{.Body}}",
"_icon": "{{.Icon}}",
"_image": "{{.Image}}",
"_launch_id": "{{.LaunchID}}",
"_vibration": "{{.Vibration}}",
"_soundless": "{{.Soundless}}",
"_color": "{{.ImageBackgroundColor}}",
"_click_action": "{{.ClickURL}}",
"_hub_link": "{\"open\": \"{{.URLOpenEvent}}\", \"ack\": \"{{.URLDelivEvent}}\"}",
"_buttons": "[{{ range $index, $button := .Actions }}{{if $index}},{{end}}{\"label\":\"{{$button.Label}}\",\"link\":\"{{$button.Link}}\"}{{ end }}]"
},
"android": {
"priority": "HIGH",
"ttl": {{.TTL}}
}
}
}
uid — internal send ID, unique for each message.
launch_id — internal send ID, unique within the mailing.