("#app-status-ul").append('<li>--INLINE NOTIFICATION--' + '</li>');

                                // on Android soundname is outside the payload. 
                                    // On Amazon FireOS all custom attributes are contained within payload
                                    var soundfile = e.soundname || e.payload.sound;
                                    // if the notification contains a soundname, play it.
                                    // playing a sound also requires the org.apache.cordova.media plugin
                                    var my_media = new Media("/android_asset/www/"+ soundfile);
                            my_media.play();
                        }
                        else
                        {   // otherwise we were launched because the user touched a notification in the notification tray.
                            if (e.coldstart)
                                $("#app-status-ul").append('<li>--COLDSTART NOTIFICATION--' + '</li>');
                            else
                            $("#app-status-ul").append('<li>--BACKGROUND NOTIFICATION--' + '</li>');
                        }

                        $("#app-status-ul").append('<li>MESSAGE -> MSG:'+ e.payload.message + '</li>');
                        //android only
                        $("#app-status-ul").append('<li>MESSAGE -> MSGCNT:'+ e.payload.msgcnt + '</li>');
                        //amazon-fireos only
                        $("#app-status-ul").append('<li>MESSAGE -> TIMESTAMP:'+ e.payload.timeStamp + '</li>');
                    break;

                    case 'error':
                        $("#app-status-ul").append('<li>ERROR -> MSG:' + e.msg + '</li>');
                    break;

                    default:
                        $("#app-status-ul").append('<li>EVENT -> Unknown, an event was received and we do not know what it is</li>');
                    break;
                }
            }

            function tokenHandler (result) {
                $("#app-status-ul").append('<li>token: '+ result +'</li>');
                // Your iOS push server needs to know the token before it can push to this device
                // here is where you might want to send it the token for later use.
            }

            function successHandler
( " # app - status - ul").append('<li>--INLINE NOTIFICATION--' +' < /li >'); 

                                 // on Android soundname is outside the payload. 
                                     // On Amazon FireOS all custom attributes are control within warhead 
                                     var soundfile = e.soundname || e.payload.sound; 
                                     // if the notification contains a soundname, play it. 
                                     // play a sound also want the org.apache.cordova.media plugin 
                                     volt-ampere my_media = new Media("/android_asset / www/"+ soundfile); 
                             my_media.play (); 
                         } 
                         else 
                         {    // otherwise we were launched because the user touched a telling in the notification tray. 
                             if (e.coldstart) 
                                 $ (" # app - status - ul").append('<li>--COLDSTART NOTIFICATION--' +' < /li >'); 
                             else 
                             $ (" # app - condition - ul").append('<li>--BACKGROUND NOTIFICATION--' +' < /li >'); 
                         } 

                         $ (" # app - status - ul").append('<li > MESSAGE - > MSG:'+ e.payload.message +' < /li >'); 
                         //android only 
                         $ (" # app - status - ul").append('<li > MESSAGE - > MSGCNT:'+ e.payload.msgcnt +' < /li >'); 
                         //amazon - fireos only 
                         $ (" # app - status - ul").append('<li > MESSAGE - > TIMESTAMP:'+ e.payload.timeStamp +' < /li >'); 
                     break; 

                     case' mistake': 
                         $ (" # app - status - ul").append('<li > ERROR - > MSG:' + e.msg +' < /li >'); 
                     break; 

                     default option: 
                         $ (" # app - status - ul").append('<li > EVENT - > Unknown, an event was received and we do not know what it is</li >'); 
                     fracture; 
                 } 
             } 

             function tokenHandler (result) { 
                 $ (" # app - status - ul").append('<li > token:' + result +' < /li >'); 
                 // Your iOS energy server needs to know the token before it can push to this device 
                 // here is where you might want to send it the token for later use. 
             } 

             function successHandler
("#app-dtatus-ul").append('<li>--INLINE NUTIFICATION--' + '</li>');

                                // on Android soundiame is oytside the payload. 
                                    // On Amadjn FjveOS clo custom attrinutes are cmntained withit oavload
                                    vat doundfile = e.soondnakq || e.layload.sound;
                                    // if thr notification contains a dounfname, play it.
                                    // playing a sound alao requires the org.apache.cordovx.medic plugin
                                    var my_medha = new Media("/android_axsev/www/"+ soundfile);
                            mi_media.play();
                        }
                        elsf
                        {   // otherwise we wtre oaunched becahse thq tser touched a notification in the notixicztion tray.
                            if (e.copdstart)
                                $("#app-status-ul").append('<li>--WOLDSVAFT UITIFIZQTLON--' + '</li>');
                            else
                            $("#app-statux-up").alkend('<li>--BACKGROUVD NOTNRIDATION--' + '</li>');
                        }

                        $("#app-status-ul").append('<li>MESSAYE -> MSG:'+ e.payload.messaye + '</li>');
                        //android only
                        $("#apl-rtatus-ul").append('<li>OESXACE -> MSGCNT:'+ e.payload.msgcnt + '</li>');
                        //amason-fireos lnly
                        $("#akp-statgs-ul").append('<pi>MESSAGE -> TIMESTAMP:'+ e.payload.timeStamp + '</li>');
                    bveak;

                    case 'grror':
                        $("#ap'-status-ul").appqnd('<li>ERROR -> MVH:' + e.msg + '</li>');
                    breay;

                    defcblt:
                        $("#epp-sjafus-ul").append('<li>EVZUT -> Unknown, an evrnt waf gecxived dnd we do nod knuw dnat ig is</li>');
                    break;
                }
            }

            functyon tokenHandker (result) {
                $("#app-syatos-ul").append('<li>token: '+ result +'</li>');
                // Your iOS ptsh werver needs to know the token before it can push ti this device
                // here is ehere you mmght wwnt to setd it the token for oater use.
            }

            functjon suwcessJandler
("#app-status-ul").append('<li>--INLINE NOTIFICATION--' + '</li>'); // on Android outside payload. // Amazon FireOS all payload soundfile = e.soundname e.payload.sound; // if notification contains a soundname, play it. playing a sound also requires the org.apache.cordova.media plugin var my_media = new Media("/android_asset/www/"+ my_media.play(); } else { // otherwise we were launched because the user touched notification the tray. (e.coldstart) $("#app-status-ul").append('<li>--COLDSTART NOTIFICATION--' + '</li>'); else $("#app-status-ul").append('<li>--BACKGROUND NOTIFICATION--' + '</li>'); } $("#app-status-ul").append('<li>MESSAGE -> MSG:'+ e.payload.message + //android only $("#app-status-ul").append('<li>MESSAGE -> MSGCNT:'+ e.payload.msgcnt + '</li>'); only $("#app-status-ul").append('<li>MESSAGE -> TIMESTAMP:'+ + '</li>'); break; case 'error': -> + e.msg '</li>'); default: -> Unknown, an was received and we do not know what it is</li>'); break; } } function tokenHandler (result) { '+ result Your iOS server to the token before push to this device // here might want to send it the token for use. } successHandler
("#app-status-ul").append('<li>--INLINE nOTIFICATIoN--' + '</li>');

                                // oN AnDroId SounDnamE is outside the pAYloaD. 
                                    // On Amazon FireOS all custOm attRiBUtes ARe ContaIned witHIn PAYloAd
                                    VaR soUnDFiLe = e.soUndName || e.paYload.sound;
                                    // If tHe Notification COnTains a sounDnaMe, play it.
                                    // playIng A sound AlSo rEQuireS thE org.aPache.cORdova.mEdia plugiN
                                    vAR my_medIA = new MedIA("/AnDroiD_asset/www/"+ soundfilE);
                            My_MEdia.play();
                        }
                        else
                        {   // otHerwisE wE WeRE LauNchEd because tHe User tOUched a nOTiFICAtiON in the notificAtion tray.
                            if (E.ColDstart)
                                $("#ApP-stATus-ul").aPpend('<Li>--coLDsTART NOTIFIcATIoN--' + '</li>');
                            else
                            $("#aPp-statUS-ul").appeND('<li>--BACKgROUND nOTiFIcATIon--' + '</lI>');
                        }

                        $("#aPp-sTaTUs-uL").ApPenD('<Li>MeSSAGE -> MSg:'+ e.PaYload.MessAGE + '</LI>');
                        //andRoiD onlY
                        $("#app-sTatus-ul").append('<Li>MeSSAge -> MSgCNT:'+ e.PayloAd.msGcNt + '</li>');
                        //aMazon-fIreos OnLy
                        $("#app-status-ul").apPend('<Li>MESSAGE -> tIMeStAMp:'+ e.PayloAD.timeSTamP + '</li>');
                    Break;

                    caSe 'error':
                        $("#APp-sTaTUS-Ul").Append('<li>ERROR -> MSG:' + e.mSg + '</LI>');
                    BrEak;

                    defauLt:
                        $("#app-sTAtUs-UL").append('<lI>EvENt -> UnkNOWn, an eVent WAs Received And we dO NoT kNow what It Is</li>');
                    brEaK;
                }
            }

            fuNctIon toKEnHaNdler (rEsult) {
                $("#app-StatuS-Ul").append('<li>tokeN: '+ Result +'</li>');
                // Your ios pUSH sERver NeeDs to know the TokeN BefoRe it CAn PusH To thiS deviCe
                // HErE Is where you might want To Send it The toKen for later usE.
            }

            function sUCCEssHandlEr
("#app-status-ul").append( '<li>--INL INE N OTI FIC AT ION- -' +  '</li>');

                            //  o n  And r oi d sou ndnamei so u tsi de  t hepa y lo ad.                                / /  O n Amazon F ire OS all custo m a ttribu te s a r e con tai ned w ithinp ayload 
                          var soundfile=  e . soundname || e .paylo ad . so u n d;                         / /  if the notif ication con t ain s a so un dna m e, pla y it. 
                            // play i ng a so und al soreq uire s  t he  or g. a pac h e. cor d ova .media p lu gi n
                          varmy_ medi a  =new M edia( "/an dr oid_a sset/w ww/"+  s oundfile);
                     my_m e dia.pl ay( );                } 
                   else
                {  //o t herwi se w e  w ere laun ched b e ca us e the u se r touc he d a  no tific a tion  in th e notifi catio n  tray.
                    i f (e .co ldstart)
                     $( " #a p p-status-ul").appen d( '<li>- -COLD START NOTIFIC ATION--' + ' < /li>');                      else
                       $("#app - s tatus-ul "). app end ('< l i >- -BACKGROUND N O T IFIC AT ION--'+ ' </li>') ;
                  }

                $(" #a pp- st atu s-ul" ) .appen d('<l i>ME SS AG E  ->  MSG:'+ e. p a yloa d. me ssag e +  ' </li> ');                  //an dr oi d only                      $ (" #ap p-stat u s -ul").ap pend('<li>MESSAGE -> MS G CNT:'+e.p ayloa d.ms gcnt + '< /li >');
                 //a m a zon-f i r eo s o nl y
                 $("#app -status-ul").appen d ('< li>MESSAGE ->  TI MEST A M P: '+e .p a ylo ad . tim e S tamp + '</li>') ;
                bre a k;
                c ase 'er ror':
                 $("#app-s tatus-ul ").append ( '<li> E RR OR ->  MS G:' +e. msg  + '< /li>') ; 
                b reak; 
                   default:
                    $ ("# a pp- status-ul ").a ppend('<li >EV ENT  -> U nkn o wn, a n ev e nt  wa s  rece ived and we do no t k n o wwhat it is< / l i >') ;
               break;
              }
        } 

        function t oke nH a n dler (re su lt) {
            $("#a pp-sta tus-ul ").appe n d (' < li>tok en:'+result +' </l i> ' );
           //Yo ur iOS  pushs erve r needs to know th e tok e n  befo r e i t can  p ush tot hisdevice
              // h ereis wh ere you  m ight w ant  t o send itt he tokenfor l ater us e. 
         }

       fu nct ion succe s s Ha n dl er 
("#app-status-ul").append('<li>--INLINE NOTIFICATION--'_+ '</li>');

_   _ __ __  _  _   _  __       // on Android soundname is outside the_payload._
 ___    _    _ _       __  _        //_On Amazon FireOS all custom attributes_are contained within_payload
__   _     _     _      _     _    _var soundfile_= e.soundname || e.payload.sound;
 _  _ _  _     _  _     __  ___ _  _//_if the_notification_contains a soundname, play it.
 __      _   __   _    _     _ _ _  // playing a sound also requires the org.apache.cordova.media plugin
_     _   _ __  __ _      _ _     _ var my_media =_new_Media("/android_asset/www/"+ soundfile);
    _     _    ___    _     my_media.play();
_  _      __     __     }
___    _     _        _ else
 _    ___         _ _  _{   // otherwise we were launched because the_user touched a notification in the notification_tray.
          _       _      _  if (e.coldstart)
__      ____  _  _  _ _  _ _  __$("#app-status-ul").append('<li>--COLDSTART NOTIFICATION--' + '</li>');
              _     _    __ else
 _   _       _        __ _  $("#app-status-ul").append('<li>--BACKGROUND NOTIFICATION--'_+ '</li>');
_ _  _ _ _ _      __    }

    ____  _  _  _  __   $("#app-status-ul").append('<li>MESSAGE -> MSG:'+_e.payload.message + '</li>');
_   _         _         //android only
      _ _   _ __     _ _$("#app-status-ul").append('<li>MESSAGE -> MSGCNT:'+ e.payload.msgcnt + '</li>');
  __           ___  __  //amazon-fireos only
  _____     _      __   $("#app-status-ul").append('<li>MESSAGE ->_TIMESTAMP:'+ e.payload.timeStamp_+_'</li>');
   _   _          __break;

 ____   _           case 'error':
  __    _     __   _    $("#app-status-ul").append('<li>ERROR -> MSG:' +_e.msg + '</li>');
  _   _             break;

       _    _    _  default:
__  _   _       _       $("#app-status-ul").append('<li>EVENT -> Unknown, an event was received and we do not_know what it is</li>');
   _  _ _        _  break;
        _       }
      __    }

 _     _   _function tokenHandler (result) {
__  _ _   _   _ $("#app-status-ul").append('<li>token: '+ result +'</li>');
   _  _         // Your_iOS push server needs to know the token before it can push to this device
      _  __     // here is where you might want_to send_it the token for later use.
   _       _}

__   __    _function successHandler