Using Baidu Delivery Channel in a Campaign
Delivery Channels are specified per-message in the campaign editor. To configure a message for Baidu, the sending mode must be “SMS Only” and the Delivery Channel should be the Baidu Delivery Channel configured above.
Baidu Android Message Payloads
Connect's Baidu Delivery Channel assumes that the content used to create each Baidu message is JSON object. A JSON payload in Baidu must contain at least two elements:
registration_ids - a JSON list containing the Registration ID of the destination.
data - a JSON array containing the key/value pairs of the message payload.
A sample JSON message is shown below.
{
"title"
:
"hello"
,
"description"
:
"hello world"
"notification_builder_id"
:
0
,
"notification_basic_style"
:
7
,
"open_type"
:
0
,
"pkg_content"
:
""
,
"custom_content"
:{
"key"
:
"value"
},
"target_channel_id"
:
"<%[channelAddress()]%>"
}
Baidu allows additional JSON keywords to be defined to control how the Baidu servers handle the message.
Configuring FCM Message Content in the CONNECT Campaign Editor
In the message content screen, specify the FCM content as a short text content URL. Static content or scripted static content URLs may use CONNECT merge tags. Note that FCM requires the message payload to contain the Registration ID of the destination device, so if static content is used, it must contain the merge tag of the Registration ID:
{
"target_channel_id"
:
"<%[channelAddress()]%>"
... }
In the fragment above, <%[channelAddress()]%> is the merge tag for the customer attribute that contains the Baidu Channel ID for the Android device. Other merge tags may be used in the JSON content as well. For example, if the score and time values used above were supplied as Event Parameters in an Event-Triggered campaign, they could be used as merge tags in the static content template shown below
{
"title"
:
"hello"
,
"description"
:
"hello world"
"custom_content"
:{
"key"
:
"value"
},
"target_channel_id"
:
"<%[channelAddress()]%>"
}
This static content template could be used to produce the sample JSON message shown above.