This commit is contained in:
2024-09-10 10:49:08 +08:00
parent b5fd06b800
commit dd4f5938da
6391 changed files with 722800 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
'use strict';
const uniPush = uniCloud.getPushManager({
appId: "__UNI__71D61A3"
})
exports.main = async (event, context) => {
//event为客户端上传的参数
const body = JSON.parse(event.body)
console.log('入参', {
cids: body.cids
});
const data = await uniPush.getDeviceStatusByCid(body.cids)
//返回数据给客户端
return data
};

View File

@@ -0,0 +1,7 @@
{
"name": "queryCids",
"dependencies": {},
"extensions": {
"uni-cloud-push": {}
}
}

View File

@@ -0,0 +1,19 @@
'use strict';
const uniPush = uniCloud.getPushManager({
appId: "__UNI__71D61A3"
})
exports.main = async (event, context) => {
//event为客户端上传的参数
console.log('event : ', event)
let obj = JSON.parse(event.body)
return await uniPush.sendMessage({
"push_clientid": obj.cids, // 设备id支持多个以数组的形式指定多个设备如["cid-1","cid-2"]数组长度不大于1000
"title": obj.title, // 标题
"content": obj.content, // 内容
"payload": obj.data, // 数据
// "force_notification": true, // 服务端推送 需要加这一句
// "badge": +1, // 服务端推送 需要加这一句
"request_id": obj.request_id //请求唯一标识号10-32位之间如果request_id重复会导致消息丢失
})
};

View File

@@ -0,0 +1,7 @@
{
"name": "unipush",
"dependencies": {},
"extensions": {
"uni-cloud-push": {}
}
}