Skip to content
webtoapkfree

Can I add push notifications to a WebView app?

Yes, but not with web push. WebView app push notifications need native code such as Firebase Cloud Messaging plus the Android 13 notification permission.

GuidesNookesh Karri

Light cover card with the title 'Can I add push notifications to a WebView app?' in dark text and a green accent bar

Yes, you can add push notifications to a WebView app, but not by reusing your website’s web push. Android WebView doesn’t support the Push API or the Notification API, so the notification has to come from native app code, usually Firebase Cloud Messaging (FCM). The page inside the WebView can still trigger and react to notifications through a small JavaScript bridge.

Why web push doesn’t work inside a WebView

Web push fails in a WebView because the WebView never implemented the two browser APIs it depends on. MDN’s compatibility data lists the PushManager interface as supported in Chrome for Android since version 42, but not supported at all in WebView Android. The Notification API is also marked unsupported in WebView, with an open Chromium tracking bug.

The confusing part is that service workers do run in WebView. MDN shows service worker registration supported there since version 40. The Push API needs “an active service worker” that subscribes through PushManager.subscribe(), and that call is what’s missing.

So your site’s “Turn on notifications” button works in Chrome and does nothing in the app, or never shows up. On the Chromium service-worker-discuss list, the advice for this case was to receive regular Android notifications through the host app instead.

How WebView app push notifications actually work

WebView app push notifications work by splitting the job between the Android shell and your website. The native side receives and displays the message. The web side decides who gets what.

  1. Add FCM to the Android project. The Firebase setup guide covers the SDK, the google-services.json file and a messaging service class.
  2. Get the device token in native code. FCM gives each install a registration token.
  3. Pass the token to your site. Expose a small method to the page with addJavascriptInterface, or load a URL that includes the token, then save it against the signed-in user on your server.
  4. Send from your server. Your backend calls FCM with that token when something happens, like a new order.
  5. Open the right page on tap. Put a URL in the message data. When the user taps the notification, the activity reads it and loads it in the WebView.

Be careful with the bridge in step 3. Android’s WebView guide warns that “Using addJavascriptInterface lets JavaScript control your Android app.” Only expose it to pages you wrote, and keep the exposed methods narrow, such as getPushToken().

The Android 13 notification permission

Since Android 13, a WebView app must ask the user before it can show any notification. Firebase says the new runtime permission “affects all apps running on Android 13 or higher that use FCM notifications.” The app has to request android.permission.POST_NOTIFICATIONS, and it “will not be allowed to show notifications until the user has granted this permission.”

Android’s notification permission page is blunt: on these versions, “your app’s notifications are off by default.” Media sessions and a few other cases are exempt. Ordinary alerts are not.

You don’t have to touch the manifest, because FCM SDK version 23.0.6 or higher already declares the permission. The prompt is your job. Ask after a user places an order, not on first launch.

Firebase also says FCM clients need Android 7.0 or higher with the Google Play Store app installed, so phones without Google Play services won’t get these messages.

Push options for a website app compared

The right push setup depends on how your app shows the website. A plain WebView wrapper needs native push, while a Trusted Web Activity can lean on Chrome.

Option Uses your site’s web push? Native code needed Main catch
WebView wrapper + FCM No Yes: FCM SDK, token bridge, tap handling A second push system to run
Trusted Web Activity Yes, through Chrome Small Needs Chrome on Android 72 or newer
No push (email or in-app badges) Not applicable None Users must open the app or inbox

A Trusted Web Activity runs your site in the user’s Chrome, not in a WebView. The Android docs say it’s available in Chrome on Android version 72 and above. The Chromium team listed “web notification delegation” among the features they added for these apps, which lets them use the web push you may already have.

Common mistakes when adding push

Most push problems in WebView apps come from treating the app like a browser. The ones I see most:

  • Assuming web subscribers cover app users. They don’t. App users need their own tokens.
  • A permission prompt on first launch. On Android 13 and up, a refused prompt leaves notifications off.
  • A broad JavaScript bridge. If the WebView can load third-party pages, any of them could call it.
  • No tap target. A notification that only opens the home page wastes the click.

My take: if your site already has working web push and you control the domain, build a Trusted Web Activity. If you’re wrapping the site in a WebView anyway, plan FCM as a backend feature you will maintain, with tokens to store and sends to trigger.

Can WebToAPK Free add push notifications?

No. WebToAPK Free packages a site as a WebView app, and push notifications are not supported in the current release. If notifications are central to your app, use a builder or an Android project where you can add FCM yourself.

Your live website content still updates in the app without a new build. For what goes into a wrapper, see how to convert a website into an Android app and which apps use WebView. If you plan to publish, read whether WebView apps get rejected by Google Play and the minimum functionality rejection first.

FAQ

Will my website’s existing web push subscribers get notifications in the app?

No. Android WebView does not support the Push API or the Notification API, so the subscribe prompt your site shows in Chrome won’t work inside the app. App users need a separate native push registration.

Do I need Firebase to send push notifications to a WebView app?

Firebase Cloud Messaging is the standard route on Android, and many push services are built on it. Whatever service you use, the app needs native code to register the device and show the notification.

Why don’t my notifications show on Android 13?

On Android 13 and higher, notifications are off by default. The app must request the POST_NOTIFICATIONS permission and the user must allow it before anything appears.

Can a Trusted Web Activity use my site’s web push?

A Trusted Web Activity runs your site in Chrome rather than in a WebView, and Chrome added web notification delegation for these apps. It needs Chrome on Android 72 or newer and a site you control.

Sources