merchapp/java-mall-app-shop-admin/uniCloud-aliyun/cloudfunctions/push/index.js
2025-06-30 07:55:36 +08:00

19 lines
399 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 { log } = require("console");
const uniPush = uniCloud.getPushManager({appId:"__UNI__95F809F"}) //注意这里需要传入你的应用appId用于指定接收消息的客户端
exports.main = async (event, context) => {
console.log('event',event);
console.log('context',context);
let obj = JSON.parse(event.body);
return await uniPush.sendMessage(obj)
};