Similar question: Android 12 - Notification trampoline restrictions
My question is slightly different from the above question because I am asking for a fundamental proper way to handle the deeplinks.
I am displaying the notification triggered by the Push notification. If the app is Multi-Activity architecture and the app needs to open different Activity depends on the deeplink value, then there are 2 ways to handle:
I am an SDK developer which makes it slightly more complicated. I don't know the client's destination Activity class and if they are using Multi-Activity or Single-Activiy-multi-Fragment architecture.
Solution 2 sounds a bit hacky. Should I implement the callback to ask the client-side to return the destination Activity class given the deeplink path?
Answering my own question.
I ended up choosing Solution #2, which is the hacky solution:
The reason is that SDK needs to send the analytics before opening the client's "real" Activity.
Pre-Android 12, the SDK is architected to open the BroadCastRecevier and it sends analytics. And then the BroadCastReceiver opens the Activity.
The BroadCastRecevier is now replaced with TransparentDeeplinkHandleActivity for TargetSDK >= 31