uts:
requestEnableNotification(): Promise<boolean>{
return new Promise((resolve)=>{
notificationManager.requestEnableNotification(SjNotification.getContext()).then(()=>{
resolve(true)
}).catch((err: BusinessError) =>{
console.dir(err);
resolve(false)
})
})
}
js:
调用这个uts插件
1 个回复
DCloud_UNI_yuhe
UTS 插件使用的 API,可以参考华为文档:https://developer.huawei.com/consumer/cn/forum/topic/0202170431515683504?fid=0109140870620153026