Push Notifications API (PushEngage, Pushwoosh, OneSignal, Firebase)
Send push notifications to your Android app users with PushEngage (recommended), Pushwoosh, OneSignal, or Firebase — setup, deep links, and per-user targeting explained.
Last updated:
Push notifications reach your users even when your app is closed — for order updates, reminders, news, live tickers, or messages from your community. WebViewGold has native, built-in support for several push providers: you activate the provider you want in Config.java and enter your IDs — no coding required. App users need an internet connection to receive remote push notifications.
If you do NOT want to ask for the notification permission at the first app start, set requirePush to false in Config.java (see the push permission APIs).
Choose your push provider
Our recommendation: PushEngage
For most WebViewGold apps, we recommend PushEngage: one dashboard for iOS and Android with segments, automated campaigns, A/B tests, and analytics — plus the most complete JavaScript bridge in WebViewGold (subscriber ID, segments, and profile ID straight from your web app).
View PushEngage plans · Set up PushEngage in WebViewGold
All providers on this page are integrated natively and work the same way: activate the provider in Config.java, enter your ID, build the app, and send notifications from the provider's dashboard or API. Every provider can pass its subscriber ID to your web app, so you can also target individual logged-in users. You can even enable several providers at once: WebViewGold routes every incoming message to the provider that sent it, so each notification is shown exactly once.
| Provider | Activate in WebViewGold | Subscriber ID in JavaScript | Subscriber ID as URL parameter |
|---|---|---|---|
| PushEngage (recommended) | PUSHENGAGE_ENABLED, PUSHENGAGE_APP_ID, google-services.json | getpushengageid:// | ?pushengage_id= |
| Pushwoosh | PUSHWOOSH_ENABLED, Pushwoosh IDs (strings.xml, AndroidManifest.xml) | getpushwooshid:// | ?pushwoosh_id= |
| OneSignal | PUSH_ENABLED, ONESIGNAL_APP_ID (build.gradle) | getonesignalplayerid:// | ?onesignal_push_id= |
| Firebase Cloud Messaging | FIREBASE_PUSH_ENABLED, google-services.json | getfirebaseplayerid:// | ?firebase_push_id= |
| Local notifications (no provider) | — | — | — |
Partner link: the PushEngage links on this page are affiliate links. If you sign up through them, WebViewGold may receive a commission at no extra cost to you. All providers on this page remain fully supported.
Option 1: PushEngage remote push notifications (recommended)
PushEngage is a push notification platform for mobile apps and websites: audience segments, automated drip and triggered campaigns, A/B tests, and analytics are managed in one dashboard. WebViewGold integrates the official PushEngage SDK, so you only enter your App ID — no coding required.
Setup
- Connect Firebase and PushEngage. PushEngage delivers Android notifications through Firebase Cloud Messaging. Register the package name of your app in a Firebase project, replace the sample google-services.json in the WebViewGold project with your own (see the Firebase steps below), create a PushEngage account (or sign in to the PushEngage dashboard), and connect the same Firebase project there. PushEngage explains every step in its Android setup guide. Then copy the App ID of your app.
- Activate PushEngage in WebViewGold. Open Config.java, paste your App ID into PUSHENGAGE_APP_ID, and set PUSHENGAGE_ENABLED to true:
public static final boolean PUSHENGAGE_ENABLED = true; public static final String PUSHENGAGE_APP_ID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // your PushEngage App ID
- Build and run the app on a real device (or an emulator with Google Play services).
- Send your first notification from the PushEngage dashboard.
Combine providers if you like: PushEngage can be enabled together with OneSignal, Firebase, and Pushwoosh. PushEngage and Pushwoosh must use the same Firebase project as your google-services.json.
Open a URL from a notification
Links in PushEngage notifications are opened by Android: in your app if you verified your domain with the App Links API, otherwise in the browser.
PushEngage JavaScript APIs: subscriber ID, segments, and profile ID
Your web app controls PushEngage through simple URL calls — as a link or via window.location.href. All calls work on iOS and Android, so one web app can serve both platforms.
| URL call | What it does |
|---|---|
getpushengageid:// | Injects the subscriber ID of this device into your page as the JavaScript variable pushengage_subscriber_id. |
pushengage-register:// | Shows the native notification permission prompt and subscribes the user (like registerpush://). |
pushengage-add-segment://news,sports | Adds the subscriber to one or more segments (comma-separated). The segments must already exist in your PushEngage dashboard; names are case-sensitive. |
pushengage-add-profile://customer-123 | Links the subscriber to your own user or customer ID, so you can target a specific logged-in user. |
Read the subscriber ID, for example to store it with the logged-in user on your server:
<script>
window.location.href = "getpushengageid://";
setTimeout(function () {
if (typeof pushengage_subscriber_id !== "undefined" && pushengage_subscriber_id) {
console.log("PushEngage subscriber ID: " + pushengage_subscriber_id);
}
}, 1500);
</script>
On Android, WebViewGold also sets window.pushengage_subscriber_id automatically after every page load (an empty string while the user is not subscribed), so calling getpushengageid:// is only needed to refresh the value.
Add the user to segments with a normal link …
<a href="pushengage-add-segment://news,sports">Follow news & sports</a>
… or link the subscriber to your own user ID after login:
<script>
window.location.href = "pushengage-add-profile://" + encodeURIComponent("customer-123");
</script>
Prefer to receive the ID on your server? Set PUSHENGAGE_ENHANCE_WEBVIEW_URL to true in Config.java to append ?pushengage_id=XYZ to your WebView URL: if your WebView URL is https://www.example.org, WebViewGold calls https://www.example.org?pushengage_id=XYZ instead. At app start, WebViewGold waits up to three seconds for the ID and then loads your URL in any case. Only the initial URL request receives the parameter, so save it in a session or cookie to use it on your linked pages.
Troubleshooting: set PUSHENGAGE_LOGGING to true to see the PushEngage logs in Logcat while testing, and switch it back to false before you publish.
Option 2: Pushwoosh remote push notifications
Pushwoosh is a customer engagement platform for push notifications, in-app messages, and other messaging channels. WebViewGold integrates the official Pushwoosh SDK, so you only enter your Pushwoosh IDs — no coding required.
Setup
- Create your Android app in Pushwoosh. Sign in to the Pushwoosh website, add your Android app, and connect it to Firebase Cloud Messaging. Then copy your Pushwoosh IDs.
- Activate Pushwoosh in WebViewGold. Open Config.java and set PUSHWOOSH_ENABLED to true:

- Enter your Pushwoosh IDs in the strings.xml and AndroidManifest.xml files:


- Build and run the app on a real device.
- Send your first notification from the Pushwoosh dashboard:

Get the Pushwoosh device ID in your web app
Want to get each individual user's device ID for personalized push notifications or further processing? Retrieve it on any page via JavaScript — WebViewGold injects it as the variable pushwooshplayerid:
<script> window.location.href = "getpushwooshid://"; alert(pushwooshplayerid); </script>
Prefer to receive the ID on your server? Set PUSHWOOSH_ENHANCE_WEBVIEW_URL to true in Config.java to append ?pushwoosh_id=XYZ to your WebView URL: if your WebView URL is https://www.example.org, WebViewGold calls https://www.example.org?pushwoosh_id=XYZ instead. Only the initial URL request receives the parameter, so save it in a session or cookie to use it on your linked pages.

Option 3: OneSignal remote push notifications
OneSignal is a customer messaging platform for push notifications, in-app messages, email, and SMS. WebViewGold integrates the official OneSignal SDK, so you only enter your App ID — no coding required. This video tutorial guides you through the setup step by step:
Video tutorial: OneSignal remote push notificationsPlays from YouTube when you press play
Setup
- Create your Android app in OneSignal. Sign in to OneSignal, select your organization, and create an app with the platform Google Android (FCM). OneSignal needs the service account JSON file of your Firebase project for this. If you have not created your app in OneSignal yet, follow this video first:
Video tutorial: Create your app in OneSignalPlays from YouTube when you press play
If your Firebase project is not set up yet, this video shows you how to get the JSON file:
Video tutorial: Get the Firebase JSON file for OneSignalPlays from YouTube when you press play
Then copy the App ID from the settings of your OneSignal app. - Enter your App ID. In Android Studio, open Gradle Scripts > build.gradle (Module: app) and paste your App ID into ONESIGNAL_APP_ID.
- Activate OneSignal in WebViewGold. Open Config.java and set PUSH_ENABLED to true.
- Build and run the app on a real device.
- Send your first notification from the OneSignal dashboard: open your app, select New Message > New Push, fill in the message, and send it.
Replace ic_stat_onesignal_default.png to change the default bell icon of OneSignal push notifications.
Open a URL from a notification
To open a specific URL when the user taps your notification, add it as a custom data field with the key url (do not use OneSignal's “Launch URL”). In the OneSignal dashboard, you find these key-value fields under “Advanced settings”; with the OneSignal REST API, add the url field to the data of your API request.
Get the OneSignal subscription ID in your web app
Want to get each individual subscription ID for personalized push notifications or further processing? Retrieve it on any page via JavaScript — WebViewGold injects it as the variable onesignalplayerid:
<script> window.location.href = "getonesignalplayerid://"; alert(onesignalplayerid); </script>
Prefer to receive the ID on your server? Set PUSH_ENHANCE_WEBVIEW_URL to true in Config.java to append ?onesignal_push_id=XYZ to your WebView URL: if your WebView URL is https://www.example.org, WebViewGold calls https://www.example.org?onesignal_push_id=XYZ instead. Only the initial URL request receives the parameter, so save it in a session or cookie to use it on your linked pages. Set PUSH_RELOAD_ON_USERID to true to reload the WebView as soon as the app receives the ID from OneSignal.
Alternatively, set AUTO_INJECT_VARIABLES to true in Config.java to inject this (and other) values into JavaScript automatically, without calling a URL first.
Option 4: Firebase Cloud Messaging remote push notifications
Firebase Cloud Messaging (FCM) is Google's free messaging service for sending notifications from the Firebase console or your own server. WebViewGold integrates the official Firebase SDK, so you only add your Firebase configuration file — no coding required. This video tutorial guides you through the setup step by step:
Setup
- Rename the package name and create a Firebase project. Rename the package name of your WebViewGold Android app. Then create a Firebase project in your Firebase console.
- Register your app with Firebase. On the project overview page, click the Android icon (or Add app) and enter your app's package name as defined in this step. Enter the exact package name of your app — this value cannot be changed after registration. Then click Register app.
- Download google-services.json and replace the sample file in the app folder of the WebViewGold project with it (via Mac Finder or Windows Explorer):

- Activate Firebase in WebViewGold. Open Config.java and set FIREBASE_PUSH_ENABLED to true:

- Build and run the app on a real device and send your first notification from the Firebase console.
To subscribe all users to a Firebase topic, set firebasechanneltopic in Config.java to the name of the topic.
Open a URL from a notification
To open a specific URL when the user taps your notification, add it in the Firebase console under Additional options (optional) as a Custom data field with Key = "url" and Value = {the desired URL}.
Get the Firebase token in your web app
Want to get each individual subscription ID for personalized push notifications or further processing? Retrieve it on any page via JavaScript — WebViewGold injects it as the variable firebaseplayerid:
<script> window.location.href = "getfirebaseplayerid://"; alert(firebaseplayerid); </script>
Prefer to receive the ID on your server? Set FIREBASE_PUSH_ENHANCE_WEBVIEW_URL to true in Config.java to append ?firebase_push_id=XYZ to your WebView URL: if your WebView URL is https://www.example.org, WebViewGold calls https://www.example.org?firebase_push_id=XYZ instead. Only the initial URL request receives the parameter, so save it in a session or cookie to use it on your linked pages.
Alternatively, set AUTO_INJECT_VARIABLES to true in Config.java to inject this (and other) values into JavaScript automatically, without calling a URL first.
Option 5: Local push notifications via JavaScript
You can schedule a notification from your website with a piece of JavaScript. The notification is scheduled while the app is open and shown at the chosen time — also after your app was closed. This works without any push provider.
<script> var title = "Your cart is waiting!"; //notification title var message = "You have left a cart full of dreams and deals behind. Dont leave it feeling abandoned"; //notification message var seconds = 120; //seconds from now on var url = "https://myshop.org/cart.php"; //deep-linking URL window.location.href = "sendlocalpushmsg://push.send?s="+ seconds +"=msg!"+ message +"&!#"+ title +"&!#"+ url +""; </script>
Use it for countdowns, happy hours, reminders, and similar situations. To cancel all scheduled local push notifications, run:
<script> window.location.href = "sendlocalpushmsg://push.send.cancel"; </script>
Option 6: bubble.io push notifications (OneSignal plugin)
- Create a bubble.io app.
- Install the WebViewGold OneSignal Push plugin:

- Follow the OneSignal instructions above and the plugin instructions (see the Bubble plugin page and the plugin video tutorial).
Push permission APIs: ask at the right moment & check the current status
Request the push notification permission manually (registerpush://)
By default, WebViewGold asks for the notification permission at the first app start (requirePush = true in Config.java). Permission prompts convert better in context: set it to false and trigger the native prompt from your web app instead, for example after login or onboarding:
<a href="registerpush://">Enable notifications</a>
window.location.href = "registerpush://";
Note: This requires at least one push provider to be activated in Config.java (PUSHENGAGE_ENABLED, PUSHWOOSH_ENABLED, PUSH_ENABLED, or FIREBASE_PUSH_ENABLED).
Check the current push permission status (checkNativePushPermissions://)
To find out whether the user currently allows push notifications, call:
window.location.href = "checkNativePushPermissions://";
WebViewGold then injects the JavaScript variable nativePushEnabled (true or false) into your page. On Android 13 and higher, both the system notification setting and the POST_NOTIFICATIONS runtime permission must be granted for the value to be true. Example:
<script>
window.location.href = "checkNativePushPermissions://";
setTimeout(function () {
if (typeof nativePushEnabled !== "undefined" && nativePushEnabled) {
console.log("Push notifications are enabled");
} else {
// e.g., show your own hint and offer registerpush:// or settingsapp://
}
}, 500);
</script>
If the permission was denied permanently, you can guide the user to the system settings via the Open App Settings API (settingsapp://).
