React Native - How to show notifications of my website using WebView in React Native app (for Android)

2.9k Views Asked by At

I am using OneSignal to send notifications to my website, I want to show notifications using WebView in React Native. (For Android)

I could not find any solution.

What do I need to do for that?

1

There are 1 best solutions below

0
On

When notification event received from one signal call postMessage from website

<WebView
    source={require('./resources/index.html')}
    onMessage={(event)=> console.log(event.nativeEvent.data)}
/>

when you receive onMessage event from WebView then display Notification using any notification plugin.