When your app is in the background, Android directs notification messages to the system tray. A user tap on the notification opens the app launcher by default. but i want to start a service or BroadcastReceiver, thats possible?
if is possible please show me code.
if its impossible how can i open a url or join telegram group when notification arrived an app in background.
It is not possible to handle the notification when the app is in background as android itself handles this. But there is a hack for the thing you want to do. Create a new activity and for that activity in manifest add this (or you can do this for your homepage itself):
<intent-filter> <action android:name="splashactivity" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
Your "click_action" value in the notification should also be "splashactivity", so that android knows which activity to open. Once the notification is clicked and your activity opens you can start a service or throw a broadcast and stuff.