Web-to-App (webtoapp.design)
webtoapp.design converts a WordPress site into a native Android and iOS app using a WebView. PNFPB has a dedicated integration so users of the generated app receive push notifications.
- Create your app on webtoapp.design and copy your credentials.
- In PNFPB → Push Notification Configuration enable webtoapp.design push.
- Enter the required webtoapp.design credentials.
- Push notifications now work alongside Firebase/OneSignal for desktop, and via webtoapp.design for mobile-app users.
REST API for Mobile Apps
For custom native apps (not webtoapp.design) you can register subscriber tokens via the PNFPB REST API. The plugin uses the rest_api_init hook to register its endpoints.
Register Token
POST /wp-json/pnfpb/v1/subscribe
Content-Type: application/json
{
"device_token": "FCM_or_APNs_token",
"user_id": 42,
"subscription_option": "all",
"firebase_version": "L"
}
Disable Service Worker (App-only mode)
If your site is only accessed through a native WebView and you do not need browser push, enable the “Disable service worker” option. This prevents the browser push service worker from loading in the WebView while keeping REST API token registration active.
In settings this is controlled by: pnfpb_ic_disable_serviceworker_pwa_pushnotification = 1
Web Push + Mobile App Push Simultaneously
PNFPB supports sending to both web subscribers (Firebase HTTP v1 / WebPush) and mobile app subscribers (webtoapp.design) with every event. The plugin’s notification classes for each provider all run in parallel via Action Scheduler cron jobs.