Skip to guide
Macaron Docs

Opt-in fix notifications

Send email and push updates after a verified fix is published, with separate consent for each support conversation.

Set up delivery

Open your app or website in Macaron, then Chat setup → Fix update notifications. Email uses your own Resend sending key and a sender on a verified domain. Browser push generates per-product VAPID keys. Expo needs your project’s existing APNs or FCM configuration; add an Expo access token if your project enables push security. Direct iOS push needs your APNs P8 key, Key ID, Team ID, bundle ID and sandbox or production environment. Provider credentials and subscriber destinations are encrypted separately from coding-agent secrets. Enabling a provider does not subscribe any customer.

Install browser push

Download the worker below and serve it unchanged at /macaron-support-sw.js on your own website (Next.js: public/macaron-support-sw.js). Use the latest widget. Macaron registers a separate /macaron-support-push/<app-id>/ scope after the customer chooses Enable browser updates. It preserves your existing PWA worker and never prompts automatically. A custom path can be supplied as data-push-worker on the widget script. Browser push requires HTTPS and browser support. On iPhone and iPad, use an installed Home Screen web app. Do not register Macaron’s cross-origin download URL as a service worker.

Expo and React Native

Download the latest native component. Supply requestFixPush using your existing expo-notifications permission and token flow. Return null when permission is declined. The callback runs only when the customer chooses Enable push updates; do not obtain or register a token on mount. Store onSession in your host app’s secure storage. Your own app handles notification taps and opens support with its existing saved session. The push payload contains no conversation bearer token.

import * as Notifications from "expo-notifications";
import { MacaronSupport, acknowledgeMacaronFixPush } from "./MacaronSupport";

<MacaronSupport baseUrl="https://macaron.sh" appId="YOUR_APP_ID"
  requestFixPush={async () => {
    let permission = await Notifications.getPermissionsAsync();
    if (permission.status !== "granted") permission = await Notifications.requestPermissionsAsync();
    if (permission.status !== "granted") return null;
    const token = await Notifications.getExpoPushTokenAsync({ projectId: "YOUR_EXPO_PROJECT_ID" });
    return { provider: "expo", token: token.data };
  }}
/>

// Attach once in your host app, and remove the listener on cleanup.
const listener = Notifications.addNotificationReceivedListener(notification => {
  void acknowledgeMacaronFixPush("https://macaron.sh", notification.request.content.data);
});
// On unmount: listener.remove();

SwiftUI and APNs

Pass requestFixPush to MacaronSupportView. Use your host app’s UNUserNotificationCenter permission flow and UIApplication.registerForRemoteNotifications; wait for your app delegate to return the token. Return MacaronFixPushRegistration(provider: "apns", token: yourHexToken), or nil if permission is declined. Keep APNs keys on the server only. In your notification-received delegate, call client.acknowledgeFixPush(userInfo) only after the device receives that notification. Your notification-tap delegate should open the existing support screen; do not switch or merge customer identities based on an email address or push payload.

Publish and verify

Link the affected customer conversations to a report. Review and verify the fix, mark the report resolved, then publish its customer-facing release update. Macaron always posts in chat, and queues notifications only for subscribers who opted in before publication. Email and push contain a private seven-day link to just that fix update and its feedback buttons. It works after the original tab closes, without sharing a chat session token. Opting out, unlinking the report or publishing a newer release invalidates the old link. No notification is sent for an ordinary reply or just because a coding run completed. Customers can try the fix and choose Yes, solved or Still broken in chat. Internal verification notes are never emailed or pushed. New subscribers receive future updates, not a replay of old messages.

Receipts, retries and opt-out

Delivery activity shows queued, sending, retry scheduled, provider accepted, failed or cancelled. Provider accepted is not inbox delivery, device display or proof a customer read it. Browser push reports receipt after showNotification succeeds; native receipt requires the host listener above. Email delivery and open tracking are not inferred. A durable queue retries temporary errors up to five attempts within 23 hours; email retries use the same Resend idempotency key. Push providers can duplicate an uncertain retry, so the browser uses one stable notification tag. Revoking consent, disabling chat, changing providers, unlinking the report or superseding its release cancels pending delivery. An already submitted email or push cannot be recalled. Expired push tokens are disabled after a provider rejection.