'Android - Detect Notification click from Android library
I am developing an Android library that will show notifications in client app. On notification click, it will open client app activity whose deep link I will get in notification payload. Also, I want to detect the click event in my library.
Problem : On notification click, I can open client activity using PendingIntent.setContentIntet() but cannot find a way to detect it in my library.
One possible way was to open a Service or BroadcastReceiver on notification click and from there open client activity but Android 12 Notification Trampoline Restrictions restrict this behaviour.
Can someone please help me on this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
