package Ġcom . v on age . sample . channel . messaging Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . os . Persist able Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . nex mo . client . N ex mo Attachment Event Ċ import Ġcom . nex mo . client . N ex mo Client Ċ import Ġcom . nex mo . client . N ex mo Conversation Ċ import Ġcom . nex mo . client . N ex mo Deleted Event Ċ import Ġcom . nex mo . client . N ex mo Deliver ed Event Ċ import Ġcom . nex mo . client . N ex mo Message EventListener Ċ import Ġcom . nex mo . client . N ex mo Seen Event Ċ import Ġcom . nex mo . client . N ex mo Text Event Ċ import Ġcom . nex mo . client . N ex mo Typing Event Ċ import Ġcom . nex mo . client . request _ listener . N ex mo ApiError Ċ import Ġcom . nex mo . client . request _ listener . N ex mo RequestListener Ċ import Ġtim ber . log . Tim ber Ċ Ċ class ĠSe en Receipt Activity Kotlin Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġmessage Listener Ġ= Ġobject Ġ: ĠN ex mo Message EventListener Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Typing Event ( typing Event : ĠN ex mo Typing Event ) Ġ{} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Attachment Event ( attachment Event : ĠN ex mo Attachment Event ) Ġ{} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Text Event ( text Event : ĠN ex mo Text Event ) Ġ{} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Seen Receipt ( seen Event : ĠN ex mo Seen Event ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval ĠuserName Ġ= Ġseen Event . embedded Info . user . name ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" Event Ġ${ seen Event . initial EventId ()} Ġseen Ġby ĠUser Ġ$ userName ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Event Deleted ( deleted Event : ĠN ex mo Deleted Event ) Ġ{} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Deliver ed Receipt ( deliver ed Event : ĠN ex mo Deliver ed Event ) Ġ{} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?, Ġpersistent State : ĠPers ist able Bundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState , Ġpersistent State ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠNo Ġneed Ġfor Ġclient Ġinitialization Ġhere . ĠClient Ġinitialization Ġis Ġalready Ġdone Ġin ĠBase Application Ġclass . ĊĠĠĠĠĠĠĠ Ġ// ĠN ex mo Client . Builder (). build ( this ) ĊĠĠĠĠĠĠĠ Ġval Ġclient Ġ= ĠN ex mo Client . get () ĊĠĠĠĠĠĠĠ Ġclient . login (" JWT Ġtoken ") ĊĠĠĠĠĠĠĠ Ġget Conversation ( client ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġget Conversation ( client : ĠN ex mo Client ) Ġ{ ĊĠĠĠĠĠĠĠ Ġclient . get Conversation (" CONVER S ATION _ ID ", Ġobject Ġ: ĠN ex mo RequestListener < N ex mo Conversation > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( conversation : ĠN ex mo Conversation ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" Conversation Ġloaded ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġconversation ?. addMessage EventListener ( message Listener ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun ĠonError ( api Error : ĠN ex mo ApiError ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" Error : ĠUnable Ġto Ġload Ġconversation Ġ${ api Error . message }") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ }