<div dir="ltr"><div><div><div><div><br></div>If the app is running in the foreground, I can control what the
notification shows or does next, because I can use the parameters I sent previously in
the message to decide if I show it or not, or what I'm going to do
according to the data retrieved, before it triggers to the screen. Example:<br><br>function onNotification(e) {<br><br> tit = <a href="http://e.payload.at" target="_blank">e.payload.at</a>;<br> notif= e.payload.av;<br>
ent = e.payload.en;<br> url= e.payload.ul;<br><br> if (e.foreground) {<br>
if (ent==entID){ // a given condition<br> navigator.notification.<div>confirm(<br> notif, <br> onConfirmDo, <br> tit, <br> 'OK' <br> );<br>
function onConfirmDo(button){<br>
if(button == "1" && url){<br> openInside(url+'&imei='+imei);<br> }<br> }<br> <br> }<br> }<br> else { <br>
if (e.coldstart) {<br> //<br> }<br> else {<br> //<br> }<br> }<br>}</div><br>Of course in many cases this is not a effective solution, because I
should filter the message before she leaves the server. For instance: I
want to show a notification to all my customers under 40 y.o. According to this:<br>
<br><a href="http://aerogear.org/docs/specs/aerogear-server-push/" target="_blank">http://aerogear.org/docs/specs/aerogear-server-push/</a><br><br>...I can use "alias", "categories", etc., to perform such segmentation;
but I don't know how to send / store (?) that information into the server.<br><br></div>Another issue related to this one: is there some way I have to control over the alert on the notification
tray? That is: make it show only if a given criteria is matched?<br><br></div>Thanks<br><br></div>Miguel<br><div><div><div><br><br>
<br></div></div></div></div>