package Ġre . not ifica . push . gms . internal Ċ Ċ import Ġcom . google . firebase . messaging . Remote Message Ċ import Ġre . not ifica . Not ific are Ċ import Ġre . not ifica . internal . Not ific are Logger Ċ import Ġre . not ifica . internal . mos hi Ċ import Ġre . not ifica . models . Not ific are Notification Ċ import Ġre . not ifica . push . models . Not ific are Notification Remote Message Ċ import Ġre . not ifica . push . models . Not ific are System Remote Message Ċ import Ġre . not ifica . push . models . Not ific are Unknown Remote Message Ċ Ċ internal Ġfun ĠNot ific are Unknown Remote Message ( message : ĠRemote Message ): ĠNot ific are Unknown Remote Message Ġ{ ĊĠĠĠ Ġreturn ĠNot ific are Unknown Remote Message ( ĊĠĠĠĠĠĠĠ ĠmessageId Ġ= Ġmessage . message Id , ĊĠĠĠĠĠĠĠ Ġsent Time Ġ= Ġmessage . sent Time , ĊĠĠĠĠĠĠĠ Ġcollapse Key Ġ= Ġmessage . collapse Key , ĊĠĠĠĠĠĠĠ Ġttl Ġ= Ġmessage . ttl . to Long (), ĊĠĠĠĠĠĠĠ Ġmessage Type Ġ= Ġmessage . message Type , ĊĠĠĠĠĠĠĠ Ġsender Id Ġ= Ġmessage . sender Id , ĊĠĠĠĠĠĠĠ Ġfrom Ġ= Ġmessage . from , ĊĠĠĠĠĠĠĠ Ġto Ġ= Ġmessage . to , ĊĠĠĠĠĠĠĠ Ġpriority Ġ= Ġmessage . priority , ĊĠĠĠĠĠĠĠ Ġoriginal Priority Ġ= Ġmessage . original Priority , ĊĠĠĠĠĠĠĠ Ġdata Ġ= Ġmessage . data , ĊĠĠĠ Ġ) Ċ } Ċ Ċ internal Ġfun ĠNot ific are System Remote Message ( message : ĠRemote Message ): ĠNot ific are System Remote Message Ġ{ ĊĠĠĠ Ġval Ġignore Keys Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġ" id ", Ġ" notification _ id ", Ġ" notification _ type ", ĊĠĠĠĠĠĠĠ Ġ" system ", Ġ" system Type ", Ġ" x - sender ", Ġ" attachment " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġreturn ĠNot ific are System Remote Message ( ĊĠĠĠĠĠĠĠ ĠmessageId Ġ= Ġmessage . message Id , ĊĠĠĠĠĠĠĠ Ġsent Time Ġ= Ġmessage . sent Time , ĊĠĠĠĠĠĠĠ Ġcollapse Key Ġ= Ġmessage . collapse Key , ĊĠĠĠĠĠĠĠ Ġttl Ġ= Ġmessage . ttl . to Long (), ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġmessage . data [" id "], ĊĠĠĠĠĠĠĠ Ġtype Ġ= Ġrequire NotNull ( message . data [" system Type "]), ĊĠĠĠĠĠĠĠ Ġextra Ġ= Ġmessage . data . filter Keys Ġ{ Ġ! ignore Keys . contains ( it ) Ġ}, ĊĠĠĠ Ġ) Ċ } Ċ Ċ internal Ġfun ĠNot ific are Notification Remote Message ( message : ĠRemote Message ): ĠNot ific are Notification Remote Message Ġ{ ĊĠĠĠ Ġval Ġignore Keys Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġ" id ", Ġ" notification _ id ", Ġ" notification _ type ", Ġ" notification _ channel ", Ġ" notification _ group ", Ġ" alert ", ĊĠĠĠĠĠĠĠ Ġ" alert _ title ", Ġ" alert _ subtitle ", Ġ" attachment ", Ġ" action _ category ", Ġ" inbox _ item _ id ", Ġ" inbox _ item _ visible ", ĊĠĠĠĠĠĠĠ Ġ" inbox _ item _ expires ", Ġ" presentation ", Ġ" notify ", Ġ" sound ", Ġ" lights _ color ", Ġ" lights _ on ", Ġ" lights _ off ", Ġ" x - sender " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġreturn ĠNot ific are Notification Remote Message ( ĊĠĠĠĠĠĠĠ ĠmessageId Ġ= Ġmessage . message Id , ĊĠĠĠĠĠĠĠ Ġsent Time Ġ= Ġmessage . sent Time , ĊĠĠĠĠĠĠĠ Ġcollapse Key Ġ= Ġmessage . collapse Key , ĊĠĠĠĠĠĠĠ Ġttl Ġ= Ġmessage . ttl . to Long (), ĊĠĠĠĠĠĠĠ Ġ// ĠNotification Ġproperties ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġrequire NotNull ( message . data [" id "]), ĊĠĠĠĠĠĠĠ Ġnotification Id Ġ= Ġrequire NotNull ( message . data [" notification _ id "]), ĊĠĠĠĠĠĠĠ Ġnotification Type Ġ= Ġmessage . data [" notification _ type "] Ġ?: Ġ" re . not ifica . notification . Alert ", ĊĠĠĠĠĠĠĠ Ġnotification Channel Ġ= Ġmessage . data [" notification _ channel "], ĊĠĠĠĠĠĠĠ Ġnotification Group Ġ= Ġmessage . data [" notification _ group "], ĊĠĠĠĠĠĠĠ Ġ// ĠAlert Ġproperties ĊĠĠĠĠĠĠĠ Ġalert Ġ= Ġrequire NotNull ( message . data [" alert "]), ĊĠĠĠĠĠĠĠ Ġalert Title Ġ= Ġmessage . data [" alert _ title "], ĊĠĠĠĠĠĠĠ Ġalert Subtitle Ġ= Ġmessage . data [" alert _ subtitle "], ĊĠĠĠĠĠĠĠ Ġattachment Ġ= Ġmessage . data [" attachment "] ?. let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠNot ific are . mos hi . adapter ( Not ific are Notification . Attachment :: class . java ). fromJson ( it ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠNot ific are Logger . warning (" Failed Ġto Ġparse Ġattachment Ġfrom Ġremote Ġmessage .", Ġe ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠ Ġ// ĊĠĠĠĠĠĠĠ Ġaction Category Ġ= Ġmessage . data [" action _ category "], ĊĠĠĠĠĠĠĠ Ġextra Ġ= Ġmessage . data . filter Keys Ġ{ Ġ! ignore Keys . contains ( it ) Ġ}, ĊĠĠĠĠĠĠĠ Ġ// ĠIn box Ġproperties ĊĠĠĠĠĠĠĠ Ġin box ItemId Ġ= Ġmessage . data [" inbox _ item _ id "], ĊĠĠĠĠĠĠĠ Ġin box Item Visible Ġ= Ġmessage . data [" inbox _ item _ visible "] ?. to Boolean () Ġ?: Ġtrue , ĊĠĠĠĠĠĠĠ Ġin box Item Expires Ġ= Ġmessage . data [" inbox _ item _ expires "] ?. to Long OrNull (), ĊĠĠĠĠĠĠĠ Ġ// ĠPresentation Ġoptions ĊĠĠĠĠĠĠĠ Ġpresentation Ġ= Ġmessage . data [" presentation "] ?. to Boolean () Ġ?: Ġfalse , ĊĠĠĠĠĠĠĠ Ġnotify Ġ= Ġmessage . data [" notify "] Ġ== Ġ" 1 " Ġ|| Ġmessage . data [" notify "] ?. to Boolean () Ġ?: Ġfalse , ĊĠĠĠĠĠĠĠ Ġ// ĠCustom isation Ġoptions , ĊĠĠĠĠĠĠĠ Ġsound Ġ= Ġmessage . data [" sound "], ĊĠĠĠĠĠĠĠ Ġlights Color Ġ= Ġmessage . data [" lights _ color "], ĊĠĠĠĠĠĠĠ Ġlights On Ġ= Ġmessage . data [" lights _ on "] ?. toInt OrNull (), ĊĠĠĠĠĠĠĠ Ġlights Off Ġ= Ġmessage . data [" lights _ off "] ?. toInt OrNull (), ĊĠĠĠ Ġ) Ċ } Ċ