> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Push permission

> How the MaihueGO app asks for permission to send push notifications: the pre-permission screen with Turn on and Not now, the iOS prompt, what each answer means, and how the customer turns push back on in iOS Settings.

## At a glance

| Field | Value |
| - | - |
| Status | **Available** |
| Where | The **Turn on your notifications** screen, opened over Home; the iOS prompt shows only after **Turn on** |
| Who sees it | Signed-in customers whose phone has not answered the permission yet. Never before sign-in |
| Feature flag | None |
| Last verification | 2026-11-12 against `develop` (`679a4e0c5`) |

## What it is for

Without the phone's permission, no push from MaihueGO shows up: not the coupon that is now in the wallet, not the
declined charge. The permission belongs to the iPhone, not to MaihueGO: iOS shows its prompt only once, and after
that it changes only in iOS Settings. That is why the app first explains what the notices are for and asks for the
system permission only when the customer taps **Turn on**.

## How to get there

* **On reaching Home signed in:** the app opens **Turn on your notifications** if the phone can still ask. It shows
  at most once per app launch.
* **After Not now:** it shows again after 7 days. After the third **Not now** it does not show again.
* **Anytime:** the customer changes the permission in iOS **Settings**, or from the app through the banner in
  [Notification preferences](https://docs.bbrands.io/maihuego/notifications/preferences.md).

## What the customer sees

![MaihueGO \[DEV\] Turn on your notifications screen on an iPhone: a blue bell, the title Turn on your notifications, the text We only notify you about what matters. You can change it anytime in Preferences, three cards (Your coupons, Your charges, Service status) and the buttons Turn on and Not now.](https://mintcdn.com/bbrands/R8svkTwtsbWGDPOo/images/maihuego-notifications-screens/push/pre-permission.en.ios.webp?fit=max\&auto=format\&n=R8svkTwtsbWGDPOo\&q=85\&s=3059f01c20d764500e78781c388c8d49)

The pre-permission screen: what the notices are for, with Turn on and Not now.

![iOS system alert over the Turn on your notifications screen: “MaihueGO \[DEV\]” Would Like to Send You Notifications, with the text about alerts, sounds and icon badges, and the buttons Don't Allow and Allow. Behind it, the Turn on and Not now buttons are disabled.](https://mintcdn.com/bbrands/R8svkTwtsbWGDPOo/images/maihuego-notifications-screens/push/permission.en.ios.webp?fit=max\&auto=format\&n=R8svkTwtsbWGDPOo\&q=85\&s=226fc520b4ecf920e6669ab71afcc438)

After Turn on: the iOS prompt, over the pre-permission screen.

| # | Element | What it does |
| - | - | - |
| 1 | **Turn on your notifications** | Title and text: "We only notify you about what matters. You can change it anytime in Preferences." |
| 2 | Cards | **Your coupons** (when a coupon reaches the wallet or is about to expire), **Your charges** (if a payment of the plan could not go through) and **Service status** (refills and machines) |
| 3 | **Turn on** | Shows the iOS prompt. While it is open, both buttons wait |
| 4 | **Not now** | Closes the screen without asking; it shows again after 7 days |
| 5 | iOS prompt | Written by iOS with the app name. **Don't Allow** denies push and iOS does not ask again; **Allow** allows it (banners, sounds and the app icon badge) |

Once the prompt is answered, the screen closes and the customer is back on Home.

## Step by step

### Turn on the notices

**1. Sign in and reach Home**

If the phone has not answered the permission yet, **Turn on your notifications** opens.

**2. Tap Turn on**

The iOS prompt shows up.

**3. Tap Allow**

The screen closes. From then on, the phone shows MaihueGO pushes.

### Leave it for later

**1. Tap Not now**

The screen closes without showing the iOS prompt, so the customer can still turn the notices on later.

**2. It shows again**

After 7 days, on reaching Home. After the third **Not now** it does not show again; iOS Settings remain.

### Turn push back on from iOS Settings

**1. Open Settings on the iPhone**

Go to **Notifications** and find **MaihueGO** in the list. Another way: **Settings** › **Apps** › **MaihueGO** ›
**Notifications** (the path changes slightly between iOS versions).

**2. Turn on Allow Notifications**

Choose where they show (Lock Screen, Notification Center, Banners) and whether they play a sound.

**3. Go back to the app**

Nothing else is needed: the app registers the change with Horizon on its own.

### Turn push back on from the app

**1. Open the preferences**

Inbox › **Preferences**, or **Account** › **Settings** › **Notifications**.

**2. Tap Open settings**

The yellow banner **Push notifications are turned off** shows only when the phone denies push. The button opens
the MaihueGO page in iOS Settings.

**3. Allow notifications and come back**

Under **Notifications**, turn on **Allow Notifications**. When the customer returns to the app, the banner
disappears.

### Stop all push

In iOS **Settings** › **Notifications** › **MaihueGO**, turn off **Allow Notifications**. To stop only promotions
and keep the important notices, use [Notification preferences](https://docs.bbrands.io/maihuego/notifications/preferences.md) instead.

## Business rules

| ID | Rule |
| - | - |
| R-01 | The app never shows the iOS prompt when it starts or before sign-in: only after **Turn on** on the pre-permission screen |
| R-02 | The pre-permission screen opens on reaching Home signed in, only while the phone can still ask (the customer never answered the prompt), and at most once per app launch |
| R-03 | **Not now** keeps it away for 7 days. After 3 **Not now** answers it does not show again on that phone |
| R-04 | The **Not now** count belongs to the phone and the install: reinstalling the app starts it over, like the iOS permission |
| R-05 | The permission alone is not enough: the customer must be signed in. Signing in links the phone to the account; signing out unlinks it, and that phone stops getting the account's pushes |
| R-06 | Pushes go to every phone where the person is signed in and has allowed push |
| R-07 | Without permission, the inbox and the email still work: only the push does not show |
| R-08 | When the permission or the subscription changes, the app registers the phone again with Horizon |
| R-09 | Phone permission and app preferences are separate: both must allow a push for it to show |

## States and messages

| State | What it means | What the customer sees in the app |
| - | - | - |
| Not decided | The prompt was never answered | **Turn on your notifications** on reaching Home (unless **Not now** was tapped less than 7 days ago, or 3 times) |
| Allowed | Push shows | Nothing |
| Denied | Push does not show | Banner **Push notifications are turned off**: "Allow notifications in your phone settings to receive push updates." with **Open settings**, in the preferences. The pre-permission screen does not show again |
| Provisional | iOS delivers quietly to Notification Center, without a banner | Nothing |

With the inbox flag off, **Account** › **Settings** › **Notifications** opens the iPhone settings of the app
directly.

## Errors

The app shows no error messages of its own about the permission. Typical support cases:

| Symptom | Cause | Support action |
| - | - | - |
| The Turn on your notifications screen never showed | The permission was already answered, the customer tapped **Not now** less than 7 days ago or 3 times, or has not reached Home signed in | Check iOS **Settings** › **Notifications** › **MaihueGO** and guide them to turn it on there |
| Push allowed but nothing arrives | The customer is not signed in, or signed in on another account | Ask them to sign in with the right account |
| Horizon Enterprise shows the push as **Unreachable** | No phone of the account has push allowed and a subscription | Guide the customer through this page |

## Why it works this way

On iPhone only iOS can ask for this permission, and it asks only once: if the customer denies it, it changes only
in Settings afterwards. Explaining first which notices they will get, and asking only once they are signed in and
chose **Turn on**, avoids spending that single prompt on someone who does not yet know what it is for. **Not now**
leaves the door open without insisting: it comes back after 7 days and stops after three times.

## Technical detail

| Aspect | Detail |
| - | - |
| Boot | `mobile/maihuego-application/hooks/useOneSignal.ts`, mounted in `app/_layout.tsx`: `OneSignal.initialize(appId)` without asking for the permission |
| When it is offered | `hooks/usePushPrePermissionPrompt.ts`, on Home (`app/(with-tabs)/home/index.tsx`): with a session and an App ID, `OneSignal.Notifications.canRequestPermission()` and `shouldOfferPushPrePermission()` from `utils/push-pre-permission.ts` (7 days, at most 3); opens `/notifications/push-permission` once per launch |
| Screen | `screens/notifications/push-permission/`: **Turn on** calls `OneSignal.Notifications.requestPermission(false)` (without OneSignal's fallback to Settings); **Not now** stores the answer in AsyncStorage (`maihuego_push_pre_permission`). Texts in `locales/<language>/notifications.json` (`pushPermission`) |
| App ID | `constants/onesignal.ts` (`getOneSignalAppId`); without one (local build without native config) OneSignal is skipped and the screen does not show |
| State read | `readOneSignalPushState()` in `utils/onesignal.ts`: subscription id, opt-in and `permissionNative()` mapped to `undetermined`, `denied`, `granted`, `provisional` (ephemeral counts as `granted`) |
| Account link | `oneSignalLogin()` sets the OneSignal external id: the person account when `account-centric-mobile` is on, otherwise the login; `oneSignalLogout()` runs on sign-out (`utils/clear-local-session.ts`) |
| Registration | Listeners `permissionChange` and `pushSubscription.change` call the device telemetry client, which registers the phone again |
| Live activities | `setupLiveActivities()` is also wired at boot (iOS only) |
| Screenshots | `.maestro/manual/permission.yaml` opens the screen by its link on a fresh install, without a session |
| Findings | Pre-permission screen: issue #2136. Fixed in issue #2212; turning the inbox on per account is still open (issue #2267) |

## FAQ and support cases

> [accordion] I don't get any push
>
> Check, in this order: push allowed in iOS **Settings** › **Notifications** › **MaihueGO**; signed in to the
> right account; Focus or Do Not Disturb off; the notice is not a promotion turned off in
> [Notification preferences](https://docs.bbrands.io/maihuego/notifications/preferences.md); and it is not night time (see quiet hours in
> [Receiving and opening a push](https://docs.bbrands.io/maihuego/notifications/receiving-a-push.md)).

> [accordion] I tapped Not now and now I want the notices
>
> The screen shows again on reaching Home after 7 days. If the customer does not want to wait, reinstalling the
> app shows it again after signing in.

> [accordion] How do I turn push back on?
>
> iOS **Settings** › **Notifications** › **MaihueGO** › turn on **Allow Notifications**. Or in the app,
> **Account** › **Settings** › **Notifications** › **Open settings**.

> [accordion] I denied it by mistake and the screen does not show again
>
> iOS shows its prompt only once and, after a denial, the app no longer offers the pre-permission screen. Turn it
> on in Settings as above; reinstalling the app also resets it.

> [accordion] I changed phones and stopped getting push
>
> Each phone has its own permission. Open the app on the new phone, sign in and tap **Turn on** on the
> pre-permission screen, or allow push in Settings.

## Related and history

* [Receiving and opening a push](https://docs.bbrands.io/maihuego/notifications/receiving-a-push.md)
* [Notification preferences](https://docs.bbrands.io/maihuego/notifications/preferences.md)
* [Push channel](https://docs.bbrands.io/enterprise/notifications/channels/push.md)

| Date | Change |
| - | - |
| 2026-11-11 | First version |
| 2026-11-12 | Turn on your notifications pre-permission screen: the iOS prompt shows only after Turn on, signed in; Not now keeps it away for 7 days, at most 3 times (issue #2136) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.