HTMLtoApphtmltoapp.net Build free
features

Push notifications for an HTML app

8 min readUpdated 2026-10-05By the HTML to App team

An HTML app on Android cannot use Web Push, because the Notification API is not available in Android WebView. Instead the app uses native push: on HTML to App Pro you paste a OneSignal App ID in the builder, the app registers the device with Firebase Cloud Messaging through OneSignal at launch, asks for the notification permission on Android 13 and later, and you send messages from the OneSignal dashboard or API.

Why Web Push does not work

Web Push relies on a service worker and the browser's push service — Chrome's. A WebView inside your app is not Chrome; it has no push service and does not expose the Notification API. Code that calls Notification.requestPermission() finds it undefined. Feature-detect it and hide the "enable notifications" button inside the app.

How native push works

  1. Create a OneSignal app (free tier available) and configure the Android platform with your Firebase Cloud Messaging credentials, following OneSignal's guide.
  2. Paste the OneSignal App ID into the builder's push step (Pro) and build.
  3. At first launch the app initialises OneSignal, and on Android 13+ asks the user to allow notifications — a system prompt the user must accept.
  4. Send from the OneSignal dashboard: to everyone, to a segment, or scheduled.

The Android 13 permission

Since Android 13, notifications are opt-in: the app must ask, and users who decline get nothing. Roughly half of users accept a well-timed request. You cannot re-prompt after a refusal; the user has to enable notifications in Settings. Explain the value before the app asks — in onboarding slides, for instance — so the answer is more often yes.

What to send (and what not to)

  • Good: order and booking updates, new content the user subscribed to, reminders they set, a new level or daily challenge in a game.
  • Bad: daily "we miss you" nudges, the same promotion three times. Notification fatigue is the top reason apps get uninstalled.
  • Keep titles under ~40 characters and the body under ~90 so nothing is truncated.

Data safety

Push registers a device identifier with OneSignal and Google. Declare "Device or other IDs" collected for app functionality in the Play Data safety form, and mention OneSignal in your privacy policy.

Questions people ask

Can an HTML app send push notifications?

Yes, through native push. Web Push is unavailable in WebViews, but an app built with HTML to App Pro registers for native push through OneSignal.

Is OneSignal free?

OneSignal has a free tier for mobile push suitable for most small apps; check their current pricing for limits.

Do notifications work when the app is closed?

Yes. Native push is delivered by Android itself, so notifications arrive whether or not the app is running.

Your HTML is one upload away from an app

Install the free builder, drop in your HTML file or ZIP, and download a signed APK in a few minutes. No watermark, no card, no Android Studio.

Build my APK free