package Ġorg . edx . mobile . dee plink Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . os . Bundle Ċ import Ġcom . google . firebase . messaging . Remote Message Ċ import Ġde . green robot . event . EventBus Ċ import Ġorg . edx . mobile . event . Push Link Received Event Ċ import Ġorg . edx . mobile . logger . Logger Ċ Ċ object ĠPush Link Manager Ġ{ ĊĠĠĠ Ġval Ġlogger Ġ= ĠLogger ( this . java Class ) ĊĊĠĠĠ Ġfun Ġcheck And React If F CM Notification Received ( activity : ĠActivity , Ġbundle : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġscreen Name Ġ= Ġbundle ?. getString ( Deep Link . Keys . SCREEN _ NAME ) ĊĠĠĠĠĠĠĠ Ġif Ġ( screen Name Ġ!= Ġnull Ġ&& Ġscreen Name . isNotEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠReceived ĠF CM Ġbackground Ġnotification ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon F CM Background Notification Received ( activity , Ġscreen Name , Ġbundle ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon F CM Background Notification Received ( activity : ĠActivity , Ġscreen Name : ĠString , Ġbundle : ĠBundle ) Ġ{ ĊĠĠĠĠĠĠĠ ĠDeep Link Manager . on Deep Link Received ( activity , ĠDeep Link ( screen Name , Ġbundle )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon F CM Foreground Notification Received ( remote Message : ĠRemote Message ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠBody Ġof Ġmessage Ġis Ġmandatory Ġfor Ġa Ġnotification ĊĠĠĠĠĠĠĠ Ġremote Message ?. notification ?. body ?. run Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . debug (" Message ĠNotification ĠBody : Ġ" Ġ+ Ġremote Message . notification ?. body ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġscreen Name Ġ= Ġremote Message . data [ Deep Link . Keys . SCREEN _ NAME ] Ġ?: Ġ"" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpush Link Ġ= ĠPush Link ( screen Name , Ġremote Message . notification ?. title , Ġthis , Ġremote Message . data ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠBroadcast Ġthe ĠPush Link Ġto Ġall Ġactivities Ġand Ġlet Ġthe Ġforeground Ġactivity Ġdo Ġthe Ġfurther Ġaction ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Push Link Received Event ( push Link )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Push Link Action Granted ( activity : ĠActivity , Ġpush Link : ĠPush Link ) Ġ{ ĊĠĠĠĠĠĠĠ ĠDeep Link Manager . on Deep Link Received ( activity , Ġpush Link ) ĊĠĠĠ Ġ} Ċ } Ċ