We are working on notification trampolines on Android 12. Originally our app launches an activity by a broadcast receiver.
I found out that using PendingIntent.getActivity
instead of PendingIntent.getBroadcast
would solve the problem.
Regarding this, I have a following concern.
When the broadcast receiver is used, i.e. when PendingIntent.getBroadcast
is used, I programmed so that the broadcast receiver determines whether to launch the app.
However, I no longer use the broadcast receiver due to notification trampolines. Therefore, PendingIntent.getActivity
launches the app without choice.
I would like to know if there is any way to determine whether to launch the app depending of the state of app without using the broadcast receiver.
For example;
- when App is in state A:Launch the app with a push notification tap
- when App is in state B:NOT launch the app with a push notification tap