我正在使用休息 API 发送百度推送通知。我无权访问 Android 的通知生成器类,所以我不能,例如,使用notificationBuilder.setPriority(2);
. 我真正需要知道的主要事情是如何将百度推送通知的优先级设置为 MAX,仅使用 JSON。
根据这个网站,这里是百度 JSON 有效负载的所有键和值:
{
//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"
}
我假设我需要设置 的值notification_builder_id
,但由于它只是将整数作为值,我不确定如何创建与 id 对应的通知。