We are working on an app which can recognize the name of the incoming call from the phone number. (Our problem is similar to this one but the solution is different) We have created a CallScreeningService which receives the phone number of the incoming phone call and we are able to display the toast showing the caller id whenever there is a call. However, instead of displaying a toast we want to display a notification. (We had also tried displaying a pop up window over Android native incoming call screen like true caller Android app but failed to show it when app is in background or closed state) Now we are also able to create a notification of caller ID whenever there is a call but it is not visually appearing on the screen.
Is it possible to make the notification visually appear on the screen at the same time as an incoming phone call? If yes, how?
Thank you so much!
Assuming you found a way to keep your app alive in doze mode you need to set your Notification's Channel importance or notification's priority to high or max(side note: Notification channel's importance overrides Notification builder's priority).
NotificationChannel:
Notification builder:
If doze mode is killing your app, you can use foreground service with return Service.START_STICKY; or WakefulBroadcastReceiver mixed with startWakefulService().