OneSignal Push Notifications for Better Messages
OneSignal is the most-installed web-push notification plugin on WordPress — it adds the browser permission prompt, manages subscriptions, and delivers push notifications through OneSignal's hosted service. The standard OneSignal WordPress plugin sends push notifications for new posts but does not natively know about private messages. Better Messages adds the missing piece: it auto-associates WordPress user IDs with OneSignal subscriptions as External User IDs, then dispatches a OneSignal push for every new private message so recipients hear about it even when their browser is closed or the site tab is in the background.
What the OneSignal integration does
When OneSignal is detected and the integration is active:
- Auto-associates WordPress user IDs to OneSignal subscriptions as External User IDs (
external_user_id). The default OneSignal plugin does not do this, but it is required to send a push to a specific recipient. - Dispatches a OneSignal push for every new private message to the recipient(s) of that thread, with the sender name, message preview, and a deep link back to the conversation.
- Respects per-user mute / DND settings in Better Messages — users who have muted a thread do not receive a push for that thread.
Installation
- Install the OneSignal Free Web Push Notifications plugin from WordPress.org.
- Configure OneSignal following OneSignal's official WordPress guide — create a OneSignal app, paste the App ID and REST API key into the plugin settings, configure the prompt.
- Install Better Messages from WordPress.org and activate it. Better Messages auto-detects OneSignal and wires the integration on activation.
That is the entire setup. There is no separate Better Messages → OneSignal settings page — the integration is "off if OneSignal is not installed, on if OneSignal is installed."
Requires the WebSocket version
The OneSignal integration runs on the WebSocket version of Better Messages. The reason: the WebSocket relay is what fans out per-thread events to subscribers, and OneSignal pushes are dispatched off that fan-out. The free (AJAX) version of Better Messages does not have the relay, so OneSignal pushes are not available there.
Frequently asked questions
Will OneSignal push notifications work for guests?
Web push subscriptions are tied to a browser, not a user. A guest who has subscribed to OneSignal on your site will receive pushes for threads they participate in — Better Messages associates the OneSignal subscription with the guest's negative user ID.
What if a user has not subscribed to OneSignal?
Then they do not receive web push notifications, which is the correct behavior — push requires explicit permission. Better Messages falls back to email notifications and the in-site unread badge.
Does this work with the mobile app?
The mobile app (iOS / Android via Capacitor) uses native APNs / FCM, not OneSignal. Mobile push notifications work on both the free and WebSocket versions of Better Messages.
Can OneSignal be used alongside another push system?
Yes — Better Messages supports multiple push backends simultaneously. If you also run Progressify or BuddyBoss Web Push, they coexist with OneSignal.
Will every message trigger a push?
The default is one push per new message, throttled by Better Messages' mute / DND settings. The fan-out respects thread participants — a sender does not get a push for their own message, and muted threads are skipped.
See also
- OneSignal integration documentation — full setup reference
- Progressify PWA push notifications — for sites using Progressify instead of OneSignal
- Real-time messaging — what the WebSocket version unlocks