Getting notifications with JS

Hi there,

I’m trying to run a function when a notification comes.

Actually here is what I want;

When a transaction notification comes to the android app, I want to get this notification then send it via api request. I’m using a real device.

Do you have any idea?

Thanks in advance