Files

21 lines
663 B
JavaScript
Raw Permalink Normal View History

2023-09-13 16:40:03 +08:00
'use strict';
const uniPush = uniCloud.getPushManager({appId: "__UNI__88BC25B"})
exports.main = async (event, context) => {
//event为客户端上传的参数
console.log('event : ', event)
let body = JSON.parse(event.body)
let res = await uniPush.sendMessage({
"push_clientid": body.push_clientid, //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
"title": body.title,
"content": body.content,
"payload": body.payload,
"force_notification": true,
"settings": {
"strategy": {
"default": 4
}
}
})
return res
};