I'm currently working on an application which receives text messages (sms) in the background (i.e when the app is closed). I don't know how to notify to the user on status bar from the service that I have registered to receive text message on the background. The NotificationCompat.Builder
class requires context as its parameter which we cannot pass in the service class.
How does Whatsapp messenger notify on the status bar when new messages arrive?
I've gone through many similar questions on stackoverflow, but none had a solution for my question. Please help me solve this problem. Any reference or small code will help.