Conditional Opening of App in Actionable Notification

Hi Team , I am facing an issue with one of the scenario in Actionable Push Notification. Case: On long press of notification , we get two actions "Accept" and "Review". On click of Accept , an api call triggers. If the API call is success we don't have to do anything but if the api call fails , we have to open the app and redirect the user to specific screen on app. There is a option to get the app on foreground on click on Accept Button, since app should not open on click of accept button but it should open when the api call gets fail on click on accept button that option is of no use. Another option I tried is to use openURL method, that also doesn't work when the app is in background

How can I solve this ?

Conditional Opening of App in Actionable Notification
 
 
Q