Need React Native OneSignal background listener for Android & IOS

980 Views Asked by At

I want background listener to update status, just like firebase provide us messages().setBackgroundMessageHandler.

One signal version

"react-native-onesignal": "^4.0.3",

1

There are 1 best solutions below

0
On

hi guys I found a solution Just use this code: messaging().setBackgroundMessageHandler(async remoteMessage => { console.log('Message handled in the background!', remoteMessage); });

Here in this code firebase will take care and get one signal's background notifications. One signal doesn't have any handler to fetch the background notifications in react native.

I hope this solution works.