diff --git a/apps.json b/apps.json index 9905a0cdc..fad1e9c6e 100644 --- a/apps.json +++ b/apps.json @@ -57,7 +57,7 @@ { "id": "messages", "name": "Messages", - "version": "0.08", + "version": "0.09", "description": "App to display notifications from iOS and Gadgetbridge", "icon": "app.png", "type": "app", @@ -95,7 +95,7 @@ { "id": "ios", "name": "iOS Integration", - "version": "0.05", + "version": "0.06", "description": "(BETA) App to display notifications from iOS devices", "icon": "app.png", "tags": "tool,system,ios,apple,messages,notifications", diff --git a/apps/ios/ChangeLog b/apps/ios/ChangeLog index 5bafc4d98..28ad78dec 100644 --- a/apps/ios/ChangeLog +++ b/apps/ios/ChangeLog @@ -4,3 +4,4 @@ 0.04: Added common bundleId's 0.05: Added more bundleId's (app-id's which can be used to determine a friendly app name in the notifications) +0.06: Fix (not) popupping up old messages \ No newline at end of file diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 6e8c864a8..846ce93d3 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -26,6 +26,13 @@ E.on('ANCS',msg=>{ function ancsHandler() { var msg = Bangle.ancsMessageQueue[0]; NRF.ancsGetNotificationInfo( msg.uid ).then( info => { + + if(msg.preExisting){ + info.new = false; + } else { + info.new = true; + } + E.emit("notify", Object.assign(msg, info)); Bangle.ancsMessageQueue.shift(); if (Bangle.ancsMessageQueue.length) @@ -100,6 +107,7 @@ E.on('notify',msg=>{ t : msg.event, id : msg.uid, src : appNames[msg.appId] || msg.appId, + new : msg.new, title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) diff --git a/apps/messages/ChangeLog b/apps/messages/ChangeLog index 5c65b150d..84c5b7551 100644 --- a/apps/messages/ChangeLog +++ b/apps/messages/ChangeLog @@ -10,3 +10,4 @@ 0.07: Added settings menu with option to choose vibrate pattern and frequency (fix #909) 0.08: Fix rendering of long messages (fix #969) buzz on new message (fix #999) +0.09: Respect the 'new' attribute if it was set from iOS integrations \ No newline at end of file diff --git a/apps/messages/lib.js b/apps/messages/lib.js index 4593c8605..acfef536f 100644 --- a/apps/messages/lib.js +++ b/apps/messages/lib.js @@ -16,7 +16,11 @@ exports.pushMessage = function(event) { if (mIdx>=0) messages.splice(mIdx, 1); // remove item mIdx=-1; } else { // add/modify - if (event.t=="add") event.new=true; // new message + if (event.t=="add"){ + if(event.new === undefined ) { // If 'new' has not been set yet, set it + event.new=true; // Assume it should be new + } + } if (mIdx<0) { mIdx=0; messages.unshift(event); // add new messages to the beginning