skip to content

In a second-hand marketplace mobile app, how should a tap on an 'offer received' notification become a screen stack the app can trust?

level: middleimportance: should knowfreq 40%

answer

  1. a tap is one more entry point
  2. route plus IDs, not content
  3. the app decides the stack
  4. whose offer, signed in as whom
  5. load current state, not the payload

basics

~20 s

Treat the tap as one more entry point: the payload names a route with offer, listing and recipient-account IDs, the link resolver builds the stack, and the screen loads the offer's current state, not the notification's copy.

solid answer

~50 s

A notification tap is an entry point like a link, so it goes through the same **entry-point resolver**. The payload carries a route, for example `offer` with `offerId`, `listingId` and the recipient's account ID, and the app decides the stack: `[browse, my listings, listing(55), offer(9)]`. Before showing it, the resolver checks who is signed in: if the offer belongs to a different account on a shared device, it must not open; if nobody is signed in, the sign-in gate parks the route. The offer screen then loads the offer from the data layer, because it may have been raised, withdrawn or expired since the notification was sent; the payload is a pointer, not the truth. A warm tap follows the same warm-start policy as a link, and a route kind this build does not know falls back to a notifications inbox.

go deeper

for a junior

Recall that tapping a notification is just another way into the app, and that it should land on the offer with a normal way back.

for a middle

Explain the payload as a route with IDs, the shared resolver that expands it into a stack, and why the screen loads the offer instead of the payload's copy.

for a senior

Show the edge checks: a tap for another account on a shared device, an expired session, a warm tap during a flow with unsaved input, and an unknown route on an old build.

for a principal

Push for one route vocabulary shared by links, notifications and in-app navigation, so the server team and the app team agree on routes rather than on screens.

## A tap is an entry point In a second-hand marketplace app, a seller gets an **'offer received'** notification and taps it. Whether the app was killed, in the background or open, the user expects to land on that offer with a sensible way back. That is the same problem a shared link poses, so the cleanest design treats a **notification tap as one more entry point** and routes it through the same **entry-point resolver** that handles links. This leaves a clear division of labour. The server, through the push system, says *which thing* the notification is about. The app says *which screens* show it and what sits beneath them. How the notification is delivered, and what a push may carry at all, is designed with the push channel; this question starts at the tap. ## What the route in the payload holds The payload should name a route in the app's own route vocabulary, with identifiers only: | Field | Example | Why it is there | |---|---|---| | Route kind | `offer` | Picks the destination and its stack shape | | Target IDs | `offerId = 9`, `listingId = 55` | Lets the screen load current data | | Recipient account | `accountId = A` | Guards against the wrong signed-in user | What it should not hold is the offer itself, its amount, buyer and status, as data for the screen to show. The notification's visible text may mention an amount, but the screen must not render from it. ## Building the stack The resolver expands the route into a **synthetic back stack** that matches how a seller would reach the offer by hand, for example `[browse, my listings, listing(55), offer(9)]`. Back then walks to the listing and the seller's listings, not out of the app. On a **cold start**, the tap launches the app and the stack is installed from nothing. On a **warm start**, the app already has a stack, and the same warm-start policy used for links applies: replace it when nothing is in progress, or push above a flow that holds unsaved input rather than discarding the user's work. Using one resolver for both kinds of entry point is what keeps a tap and a link to the same offer behaving identically. ## Checks before showing Before installing the stack, the resolver runs a few checks: 1. **Who is signed in.** On a shared device, or after an account switch, a notification for account A can be tapped while account B is signed in. Showing A's offer to B leaks data; instead, open B's own inbox or offer to sign in as A. 2. **Whether anyone is signed in.** If the session has ended, the sign-in gate stores the route as the pending destination and resumes it after sign-in. 3. **Whether the route is known.** A newer server may send a route kind an older build has never heard of. The build should fall back to a neutral screen, such as the notifications inbox, rather than crash or show nothing; how old builds treat unknown values in general is part of designing for old app versions. 4. **Whether the target still exists.** An offer that was withdrawn still opens its screen, which shows the withdrawn state, rather than an error. ## The payload is a pointer, not the truth Time passes between sending and tapping, sometimes hours. In that time the buyer may have raised the offer, withdrawn it, or the seller may have accepted another one. The offer screen therefore asks the **data layer** for offer 9 and shows its current state. This is the same *IDs, not objects* rule that applies to any route: the data layer is the single source of truth, and navigation only says where to look. ## What belongs elsewhere Delivering the notification, collapsing duplicates, permission prompts and how a framework hands the tap to the app are designed with the push channel or belong to each platform's and framework's own material. Test cases for a tap that lands mid-journey belong to mobile test design. The decision kept here is the routing one: *a tap names a route, the app builds and checks the stack, the screen loads the truth.*

  • The notification said 'Offer of 80' but the buyer has since raised it to 90; what does the offer screen show?
    It shows 90. The notification's text was accurate when sent, but the screen loads the offer by ID from the data layer, which holds its current state. Rendering from the payload would show a stale amount and might let the seller accept a price that no longer exists. The notification is a pointer to the offer, not a copy of it.
  • Why put the recipient's account ID in the route of a notification payload?
    Because the device is not the account. A shared tablet, or a user who switched accounts, can receive a notification for one account while another is signed in. With the recipient in the route, the resolver can refuse to show that offer to the wrong user and offer to switch, instead of trusting that whatever reached this device belongs to whoever is signed in.

  • The payload should carry the full offer so the screen needs no fetch.
  • A notification tap needs its own routing code, separate from link handling.
  • If the app is open, push the offer on top of whatever is showing.
  • Whoever is signed in may open any notification that reached this device.
  • An unknown route kind in a payload means the build should crash early.