try to use ancsGetAppInfo

pull/1026/head
Jeroen Peters 2021-12-08 01:40:39 +01:00
parent e93615e3d3
commit 261a680e6c
1 changed files with 9 additions and 1 deletions

View File

@ -91,6 +91,14 @@ E.on('notify',msg=>{
// could also use NRF.ancsGetAppInfo(msg.appId) here // could also use NRF.ancsGetAppInfo(msg.appId) here
}; };
var aName = '';
NRF.ancsGetAppInfo( msg.appId ).then( ai => {
aName = ai.title;
}).catch(error => {
aName = appNames[msg.appId] || msg.appId;
});
var unicodeRemap = { var unicodeRemap = {
'2019':"'" '2019':"'"
}; };
@ -99,7 +107,7 @@ E.on('notify',msg=>{
require("messages").pushMessage({ require("messages").pushMessage({
t : msg.event, t : msg.event,
id : msg.uid, id : msg.uid,
src : appNames[msg.appId] || msg.appId, src : aName,
title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer),
subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer),
body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer)