I am using a rest API to send Baidu Push notifications. I don't have access to Android's notification builder classes, so I can't, for example, use notificationBuilder.setPriority(2);
. Really the main thing that I need to know is how to set the priority of a Baidu Push notification to MAX, using JSON only.
According to this website, here are all of the keys and values for a Baidu JSON payload:
{
//android必选,ios可选
"title": "hello" ,
"description": "hello world"
//android特有字段,可选
"notification_builder_id": 0,
"notification_basic_style": 7,
"open_type":0,
"net_support" : 1,
"user_confirm": 0,
"url": "http://developer.baidu.com",
"pkg_content":"",
"pkg_name" : "com.baidu.bccsclient",
"pkg_version":"0.1",
//android自定义字段
"custom_content": {
"key1":"value1",
"key2":"value2"
},
//ios特有字段,可选
"aps": {
"alert":"Message From Baidu Push",
"sound":"",
"badge":0
},
//ios的自定义字段
"key1":"value1",
"key2":"value2"
}
I assume I need to set the values of notification_builder_id
, but as it simply takes an integer as a the value, I am not sure how to create the notification to correspond with the id.