cxc-szcx-uniapp/uniCloud-aliyun/cloudfunctions/uniPush/index.js
yangzhq68909 c1a112754c 1
2024-11-08 14:17:40 +08:00

14 lines
549 B
JavaScript
Raw 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__9F097F0"}) //注意这里需要传入你的应用appId用于指定接收消息的客户端
exports.main = async (event, context) => {
return await uniPush.sendMessage({
"push_clientid": "4033dd01957129991552f89ee7b538f1", //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
"title": "通知栏显示的标题",
"content": "通知栏显示的内容",
"payload": {
"text":"体验一下uni-push2.0"
}
})
};