Below is my code to capture notifications. I dont understand why the onNotificationPosted is not getting fired.
I am giving my app Notifications acc
It does seem to be a bit flakey, but this is the actual fix in this case:
@Override
public IBinder onBind(Intent intent) {
return super.onBind(intent);
}
I've been trying to get it working for the second day, and I succeeded. Try adding these lines at the end of onStartCommand
method.
And, it hardly plays a role, but try to declare your service after activities in the manifest file.
This comment with sample code was really helpful to me: https://stackoverflow.com/a/41521664/10652152