我已经修改了下面的代码,但这是一个面向外部的端点,移动客户端可以ping这个端点并向适当的用户发送一些推送。
但是,在我的控制台中,我得到一个错误:
UnhandledPromiseRejectionWarning:类型错误:Assert.IsNotok不是函数
function myFunc(request, response) {
var db = firestore.firestore();
db.collection("myCollection")
.doc(request.params.someParam)
.get()
.then(docSnapshot => {
if (docSnapshot.exists) {
for (var userId of request.params.userIds) {
sendPush(userId, request.params);
continue;
} else {
response.error("Unable to get param");
}
}).catch((error) => {
assert.isNotOk(error, 'Promise error');
done();
});;
});
知道我在这里做错什么了吗?谢谢