Hercules

Build your appPush Notifications

Build your app

Push Notifications

Send notifications to your users' devices. Hercules manages push notifications end-to-end: setup, permissions, and delivery.

Set up push notifications

Just ask Hercules to: Set up push notifications for my app, making sure to handle enabled, disabled, and not available states.

Prompt users to opt into notifications

We strongly recommend your app handles all of the following 4 permission states.

StatusWhat to show
Not enabledShow a pre-prompt explaining why notifications are valuable, then request permission
Explicitly enabledn/a (Notifications work normally)
Explicitly disabledGuide user to device settings to re-enable (you cannot re-prompt them to enable)
Not available on deviceHide notification-related UI or explain limitations

Send notifications to your iOS app

Your App Store build receives push notifications natively through Apple Push Notification service (APNs). The same sends reach both your web app and your iOS app, so a user signed in on both gets the notification on each device.

Apple requires a push notification key from your Apple Developer account. Apple doesn't let other services create one for you, so you create it once and upload it to Hercules.

  1. Turn on push notifications for iOS

    Click Mobile → App settings, switch on iOS push notifications, and save.

  2. Create an APNs key

    In the Apple Developer portal, open Certificates, Identifiers & Profiles → Keys and click +. Name the key, enable Apple Push Notifications service (APNs), and click Configure. Set the environment to Sandbox & Production and the key restriction to Team Scoped (All Topics), then save and register the key. A Sandbox key can't send to TestFlight or App Store builds. Download the .p8 file. Apple lets you download it only once, so keep it somewhere safe.

  3. Upload the key

    In App settings → iOS push notification key, click Upload key. Choose the .p8 file and enter the Key ID (shown on the key's page) and your Team ID (under Membership details).

  4. Build a new iOS version

    Build and submit a new iOS version. The new build asks users for permission and registers their device for notifications.

In the iOS app, tapping a notification can open a specific screen. Ask Hercules: "When a user taps an order notification in the iOS app, open that order."

Send notifications to your Android app

Your Google Play build receives push notifications natively through Firebase Cloud Messaging (FCM, Google's push service for Android). The same sends reach your web app, your iOS app, and your Android app.

FCM delivers through your own Firebase project, so you create one and give Hercules a key for it.

  1. Add your app to Firebase

    In the Firebase console, create a project (or open an existing one) and add an Android app with the package name from Mobile → App settings.

  2. Turn on push notifications for Android

    In App settings, switch on Android push notifications, upload the google-services.json file Firebase gives you under Android push notification config, and save.

  3. Create a service account key

    In the Firebase console, open Project settings → Service accounts and click Generate new private key. This downloads a JSON file. It is a different file from google-services.json, and it is a secret, so keep it somewhere safe.

  4. Upload the key

    In App settings → Android push notification key, click Upload key and choose the JSON file. Hercules checks the key with Google before it saves it.

  5. Build a new Android version

    Build and submit a new Android version. The new build asks users for permission and registers their device for notifications.

In the Android app, tapping a notification can open a specific screen, the same as in the iOS app. A notification's image also shows on Android.

Send notifications

From the Hercules UI

Go to the Push Notifications tab to send notifications manually.

When your app supplies an authenticated end user's name or email while registering a subscription, that app-scoped snapshot is shown here. Anonymous subscribers continue to show their visitor ID. Devices subscribed from your iOS app are marked iOS app, and devices subscribed from your Android app are marked Android app.

  1. Select recipients

    Choose to send to all subscribers, or search and select specific users.

  2. Compose your message

    Write a title (required) and body (optional). Keep messages short and valuable.

  3. Send

    Click Send Notification to deliver immediately.

Triggered by events

Send notifications automatically when something happens in your app. Ask Hercules:

  • "Send a notification when an order is placed"
  • "Notify users when their order ships"
  • "Send a notification when an order is out for delivery"
  • "Notify users when their order is delivered"

Scheduled from your app

Schedule notifications to send at specific times or after delays. Ask Hercules:

  • "Send a welcome notification 1 hour after sign up"
  • "Remind users about abandoned carts after 24 hours"
  • "Let me schedule notifications from an admin page"

Test push notifications

Push notifications do not work in Hercules preview. Follow the mobile app testing instructions to test on a real device:

  1. Publish your app
  2. Install on a real device (Add to Home Screen)
  3. Grant notification permission when prompted
  4. Send a test notification from Mobile → Push Notifications

FAQ

Do notifications work in Hercules preview?

No. Push notifications do not work inside the Hercules preview. You must test on a published URL

Can I send notifications to specific users?

Yes. From the Push Notifications UI, search by email, name, or visitor ID to select specific users.

How do I re-request permission if a user denied?

You can't re-prompt programmatically. Guide users to their device settings to enable notifications for your app. Show a helpful message with instructions.

Do notifications work on iOS Safari?

Yes, as of iOS 16.4+. Users must add your PWA to home screen first. Notifications won't work from Safari directly, only from the installed PWA.

Can I test iOS app notifications in the simulator?

No. Test on a real iPhone with a TestFlight build. The iOS Simulator can't register with Apple for push notifications.

Do notifications work in my App Store iOS app?

Yes, once you turn on iOS push notifications in the app's mobile settings, upload an APNs key, and build again. iOS apps have no web push, so native builds use Apple Push Notification service (APNs) instead: your app registers through window.Capacitor.Plugins.PushNotifications. See Send notifications to your iOS app.

Do notifications work in my Google Play Android app?

Yes. The Android app Hercules builds shows your app in Android WebView, which has no web push, so native builds use Firebase Cloud Messaging (FCM) from your own Firebase project instead. Turn on Android push notifications in the app's mobile settings, upload your google-services.json under Android push notification config, upload a Firebase service account key under Android push notification key, and build again. Your app registers through window.Capacitor.Plugins.PushNotifications. See Send notifications to your Android app. Browser-based Android packaging, in an early test for some accounts, hands web notifications to a compatible browser instead.

What can I customize in a notification?
  • Title: Bold headline (keep it short, max 200 characters) - Body: Main message (optional, max 500 characters) Known limitation: Web notifications can't deep-link to a specific screen. They open the app generically. In your iOS and Android apps, a tapped notification can open a specific screen.