I am working on an app like the true caller. I want to listen only to that notification that is coming from the default phone dialer app. I Have checked this, this but didn't get the right answer. My task is I want to open a dialogue box only where there is an incoming caller. I tried the following code if the package name has the string dialer through the following code.
const handleNotificationReceived = notification => {
if(notification.app.substr(notification.app.length - 6) === 'dialer'){
setNum(notification.title)
onAdd(num);
setLastNotification(notification);
}
};
I need this on android 5 and higher. Also, I am using React Native so if there is any solution in react native or android is highly appreciated.