I am trying to configure my app to redirect according to the payload data, if post_id or page_id or no payload different redirects for these three payloads.
Here is what I am getting in push details:
In above image you can see there is a payload data post_id with some value it can be page_id for sometime, so I need to check if the key is post_id or page_id in the payload data and if yes then if the value is null or not.
I tried:
pushPayload.indexOf('post_id') !== -1
parseInt(pushPayload['post_id']) > 0
msg.payload.hasOwnProperty('post_id')
but nothing worked.
Please help.