A long-lived project that still receives updates
Holds all base dependencies and configurations to have a thecore integrated with Rails Admin.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

This is part of Thecore framework.


Push Notification Test (RailsAdmin root action)

A built-in admin UI for sending Web Push test notifications. It lets you pick one or more active subscribers and fire a real notification immediately — useful for verifying the end-to-end VAPID setup without writing any code.

Prerequisites

  1. rails db:seed has run (VAPID keys generated in ThecoreSettings).
  2. At least one browser has registered a push subscription (via the React client's subscribeToPush() — see the model_driven_api README).
  3. The current RailsAdmin user can manage :push_message (or manage :all).

Accessing the action

In RailsAdmin, click Push Notification Test in the top navigation bar (root actions area).

Using the form

Field Required Description
Subscribers Yes Checkboxes listing all active PushSubscriber records — shows endpoint and associated user. Select one or more.
Title Yes Notification title (shown in bold in the OS notification).
Body Yes Notification body text.
URL No URL opened when the user clicks the notification.
Icon No URL of the notification icon image.

Click Send Test to dispatch. The backend creates one PushMessage per selected subscriber and calls PushNotificationService.dispatch for each. A flash notice reports how many notifications were sent.

Troubleshooting

Symptom Likely cause
No subscribers listed No browser has called POST subscribe yet, or all subscriptions have expired.
"Subscriber not found" error The subscriber expired between page load and submit — reload the page.
Notification not delivered Check ThecoreSettings vapid.public_key / vapid.private_key are set; check vapid.contact_email is a valid mailto: address; check the browser's notification permission is "Allow".
IntegrationLog shows errors The push service (browser vendor) returned an error — usually 410 (expired) which auto-expires the subscriber, or 400 (malformed VAPID keys).

Sending pushes programmatically

The same flow available in the UI can be triggered from anywhere in the backend:

subscriber = PushSubscriber.active.find(42)
message = subscriber.push_messages.create!(
  title: "Hello",
  body:  "This is a test notification",
  url:   "https://yourapp.com/tasks/1",
  icon:  "https://yourapp.com/icon-192.png"
)
ThecoreBackendCommons::PushNotificationService.dispatch(subscriber, message)

Or via the REST API from a privileged client (see send_push in the model_driven_api README).