> For the complete documentation index, see [llms.txt](https://help.twinr.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.twinr.dev/website-builders/base44/add-push-notifications.md).

# Add Push Notification Support

Ask Base44's AI to add Twinr push notifications, and finish the setup in your dashboard.

Push notifications need two halves: your app asks Twinr for a device token and stores it, and Twinr sends to that token later.

## Ask the AI

With [the MCP server connected](https://help.twinr.dev/website-builders/base44/add-mcp.md), ask Base44:

> Add Twinr push notifications to my app. Use the Twinr MCP tools to get what you need.

The AI fetches Twinr's push guide and writes the code.

## Answer its question

It will ask who your notifications are for:

* **Everyone** — every device that opens your app can receive a notification. No sign-in needed.
* **Specific people** — notifications aimed at one user. This needs sign-in and somewhere to store each person's device token. Base44's built-in database and authentication make this straightforward, and the AI will wire them up.

## What the code does

The AI adds a call to `twinr_push_token_fetch()`, which asks the app for the device's push token. The call is guarded, so in an ordinary browser it does nothing and your site is unaffected.

If you chose per-user notifications, it stores the token against the signed-in user so you can send to that person later.

## Publish, then finish in Twinr

**Publish your Base44 app.** The code does nothing until it is live, and your Twinr app loads the published site.

Then enable push notifications for your app in Twinr — see [Push](https://help.twinr.dev/push/overview.md). Until that is done your app requests a token and gets nothing back, which is the usual reason push appears not to work.

## Test it

1. Build your app and install it on a real device — push does not work in a browser or the previewer.
2. Open the app and let it register.
3. Send a test notification from Twinr.

{% hint style="warning" %}
A device only has a token once the person allows notifications. If tests never arrive, check the permission prompt was accepted on the device.
{% endhint %}

{% hint style="info" %}
Debugging inside the app? Use `alert()` rather than `console.log()` — console output is not visible on a phone.
{% endhint %}
