代码片段:
'use strict';
let uniPush = uniCloud.getPushManager({
appId: "UNIxxxxxx"
})
exports.main = async (event, context) => {
try {
let res = await uniPush.sendMessage({
"push_clientid": "8c258634069d038de60511f1ca487283",
"title": "title",
"content": "content",
"payload": "content"
})
return {
code: 200,
data: res
}
} catch (e) {
//TODO handle the exception
return {
data: e,
code: 500
}
}
};
本身云函数没问题,但是加上uniPush.sendMessage({})这行代码就报错,
报错信息 :
"errMsg": "The request processing has failed due to some unknown error.",
"errCode": "InternalError",
"code": "InternalError",
"forceReturn": false
DCloud_uniCloud_WYQ
打印下日志看看云函数执行时间多久
2023-01-09 20:39
_yin (作者)
回复 DCloud_uniCloud_WYQ: 第一次耗时4.76秒,后面都在在345ms左右
2023-01-10 08:38