Files
2026-01-04 11:09:06 +08:00

17 lines
584 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 简单的使用示例
'use strict';
const uniPush = uniCloud.getPushManager({
appId: "__UNI__663111E"
}) //注意这里需要传入你的应用appId
exports.main = async (event, context) => {
let data = {
...event
}
return await uniPush.sendMessage({
"push_clientid": data.push_clientid, //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
"force_notification": true, //填写true客户端就会对在线消息自动创建“通知栏消息”。
"title": data.title,
"content": data.content,
"payload": data.payload
})
};