Sub topic 9
Asking for permissions at the right moment
This chapter assumes you know what a first-run flow is and have seen system permission dialogs for notifications, location, camera, or contacts. It also assumes you can read basic TypeScript. The goal is to decide when and how to ask for a permission so that more users grant it and fewer users feel pressured.
Why timing matters
A permission request is a gate between your app and a capability. The operating system or browser controls that gate, not your app. This creates three constraints that shape the design.
- The system prompt is shown by the platform, so you cannot change its wording, buttons, or styling.
- The prompt is often one-shot. On iOS, once the user denies a permission, the app cannot show the system prompt again. On the web, browsers may suppress repeated prompts or treat a dismissed prompt as a soft block.
- A denial is expensive to undo. The user must open system or browser settings, find your app, and change the setting by hand. Most users never do.
Because of this, the first request is the one that counts. Spending it on a user who has no context for it wastes a limited resource.
The problem with asking on first launch
A common mistake is to fire permission prompts as soon as the app opens. The user has not seen any value yet. They do not know why the app needs their location or why it wants to send notifications. The most likely response to an unexplained prompt is "Don't Allow".
This conflicts with the goals from earlier chapters. Time to value gets longer when the first screen is a stack of system dialogs. A denial can also remove the capability that delivers the first value, so the user may never reach activation.
Ask in context
The best moment to ask is when the user is about to use a feature that needs the permission, and the reason is obvious from what they just did.
| Permission | Poor moment | Better moment |
|---|---|---|
| Camera | App launch | The user taps "Scan receipt" |
| Location | After sign-up | The user taps "Find stores near me" |
| Contacts | Welcome screen | The user taps "Invite friends" |
| Notifications | App launch | After the user follows a topic or sets a reminder |
| Microphone | Welcome screen | The user taps the record button |
In each better case, the user's own action explains the request. The system prompt then reads as a natural step, not an interruption. This is called a just-in-time request.
Some permissions have no single trigger. Notifications are the main example. The app can only judge the right moment by watching what the user does. A good signal is a completed action that notifications would extend, such as placing an order (for delivery updates) or creating a reminder.
Priming: explain first, then ask
Because the system prompt is one-shot, many apps use a priming step. This is a screen or dialog designed by your app that explains the benefit before the system prompt appears. It has two choices: continue, or not now.
The key property is that the priming step costs nothing to decline. If the user chooses "Not now", you have not used the system prompt, so you can ask again later. If the user chooses "Continue", you show the system prompt, and the user already knows why.
The following code implements this decision flow for web notifications. It checks the current status, only primes when the status is still default, and only calls the system prompt after the user agrees.
async function primeThenRequest(
showExplainer: () => Promise<boolean>
): Promise<NotificationPermission> {
// The browser only shows its prompt while permission is still "default".
if (Notification.permission !== "default") return Notification.permission;
const wantsNotifications = await showExplainer();
if (!wantsNotifications) return "default"; // keep the system prompt available for later
return Notification.requestPermission();
}Note the return value when the user declines. Returning "default" keeps the state honest: the browser has not recorded a decision, and your code can offer the request again at a better moment.
What a good priming screen contains
- A specific benefit in the user's terms: "Get a message when your order ships", not "Enable notifications for a better experience".
- Two clear choices with equal visual weight. Hiding "Not now" is a dark pattern, and it often produces resentful grants that are later revoked.
- No imitation of the system dialog. A fake "Allow / Don't Allow" pair that is actually your own screen confuses users, and some platform review guidelines reject it.
A warning about priming
Priming helps only when the user has a real reason to say yes. If the benefit is weak, a priming screen simply adds a step. Test whether it improves the grant rate for your app. Some permissions, such as camera access after the user taps a scan button, are so clearly motivated that priming only adds friction.
Request only what you need, and only once it is needed
Each permission should map to a specific feature. Two practices keep requests honest.
- Request the narrowest scope. If the app needs location only to find nearby stores, "while using the app" is enough. Asking for background location without a clear need raises suspicion and may fail store review.
- Request one permission at a time. Chaining three system prompts back to back makes each one feel like an interrogation. It also makes it unclear to the user which feature each one belongs to.
Where the platform allows it, offer an alternative that needs no permission. A store finder can accept a typed postcode. A photo upload can use a file picker, which on many platforms does not require full library access. When the permission is optional, the user keeps control and the feature still works.
Handling denial
A denial is a normal outcome, so design for it. Three states need handling.
- Not asked yet. Prime and request in context.
- Granted. Proceed, and avoid re-asking.
- Denied. Do not repeat the request. Show a short, non-blocking explanation at the point where the feature is needed, and give a path forward.
For a denied permission, the path forward is usually a button that opens the system settings page for the app. Pair it with plain wording that says what will not work and how to turn it on.
type PermissionState = "granted" | "denied" | "prompt";
function nextAction(state: PermissionState, hasAlternative: boolean): string {
switch (state) {
case "granted":
return "run-feature";
case "prompt":
return "show-priming";
case "denied":
return hasAlternative ? "use-alternative" : "show-settings-help";
}
}
console.log(nextAction("denied", true)); // "use-alternative"
console.log(nextAction("prompt", false)); // "show-priming"The function makes the behavior explicit and testable. In a real app you would read the state from the platform API, such as navigator.permissions.query on the web, or the authorization status APIs on iOS and Android.
Platform differences to check
| Behavior | Typical situation |
|---|---|
| Re-asking after denial | iOS does not show the prompt again. Android may allow a second request, then treats further denials as permanent. Browsers vary and may block silently. |
| One-time grants | Newer iOS and Android versions offer "Allow once" for some permissions, so your app should expect to be asked again next session. |
| Provisional notifications | iOS can deliver notifications quietly without a prompt, and the user can then choose to keep them. |
| Settings deep link | Mobile apps can open their own settings page. Browsers generally cannot, so the app must describe the steps. |
These details change between OS versions, so confirm them against current platform documentation before you rely on them.
Measuring permission requests
Treat permission requests as a mini funnel. The steps are: feature trigger, priming shown, priming accepted, system prompt shown, permission granted. Log each as an event so you can see where users drop off.
Useful measures include the grant rate at the system prompt, the acceptance rate of the priming screen, and the share of users who reach a working feature after a denial. Compare these across entry points. The same permission often performs very differently when requested from two different screens.
Common errors
- Asking for several permissions on the first screen.
- Using priming copy that talks about the app's benefit instead of the user's.
- Re-triggering the priming screen every session after "Not now", which turns it into nagging. Set a cool-down, such as waiting several days or until the user performs the triggering action again.
- Blocking the whole app after a denial when only one feature needs the permission.
- Forgetting to handle "Allow once" or revoked permissions, which leaves the feature broken without explanation.
- Treating the priming screen's "Not now" as a denial in your analytics. It is a separate outcome.
Exercise
Your photo-sharing app currently asks for camera, photo library, location, and notification permissions in four consecutive dialogs on first launch. Describe how you would restructure these requests, and name one situation where you would skip a priming screen.
Show answer
Remove all four prompts from first launch. Request each at the moment its feature is used: camera when the user taps "Take photo", photo library when they tap "Choose from library", location when they tap "Add location" to a post, and notifications after they get their first comment or follow someone, when a notification has an obvious benefit. Request one at a time. Prime notifications and location, because their benefit is not obvious from the tap alone, and track each step as an event. Skip priming for the camera: the user just tapped "Take photo", so the reason is already clear and an extra screen adds friction. Handle denial with a settings link or an alternative, such as the library picker when the camera is denied.
Exercise
A user taps "Not now" on your notification priming screen. What should the app do with the browser's permission state, and when might it ask again?
Show answer
The browser state should stay "default", because the system prompt was never shown. The app can ask again later, but only at a new relevant moment, such as after the user completes an action that notifications would extend, and after a cool-down period. Log "Not now" as its own event, separate from a system-level denial.