I have a website which is responsive and push notification feature enabled. In my native android app, if i load my website in a WebView
, then the pop up which usually comes in chrome/firefox to ask if user wants to allow push notification or not, doesn't shows up in WebView
. And obviously the WebView
won't support the same web push notification for the app. I know how to implement GCM or FCM in app to enable mobile push, but i wanted to know if it possible just to club the web push notification with android webview so that it would work in my app as it is working in chrome/firefox etc.
What I tried: After digging deeper into this, I finally concluded that as android WebView
doesn't support Push Api (with the help of caniuse.com), clubbing of web push with mobile push using WebView
is not possible as of now. Am I right? Or is there any app which already does this? Is it possible somehow?
Ow, of course this is possible! I easily implemented push web notifications from one signal in my webview App using crosswalk.
Uses crosswalk, extends Main activity to XWalkactivity Put this on on create:
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
Yeah, you will have web push notifications working!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With