Business · Product · Technology · AI

Model live-activity start, update and end by token kind

A Movo-X live-state case tracing APNs token-kind mapping, selected state projection, freshness metadata, Android data payloads and provider acceptance versus actual device activity.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: an ongoing visit has a lifecycle rather than one alert

A queue or visit surface can show changing state across waiting, called and ended phases. That requires a lifecycle and freshness policy, not simply repeated copies of an ordinary notification. The server also needs to distinguish a token that can start an activity from one associated with an existing activity.

The inspected Movo-X module builds provider payloads from selected activity state and token kinds. Ten isolated cases examine construction, provider adapters, worker reporting and control routes. They use synthetic state and injected transports, without starting an actual iOS activity or Android notification.

Project selected state while acknowledging what remains visible

The builders reconstruct selected attributes and content-state fields instead of forwarding arbitrary upstream data. Existing fixtures add patient-name, diagnosis, patient-identifier and record-number markers and check their omission. Selected kind, phase, number and display fields have their own representation rules.

Clinic name, clinician display text, queue ticket and room can remain in the allowed presentation context. This is selected-field minimization rather than anonymity or semantic deidentification of every permitted string. The fixture does not render actual preview settings or certify that every possible configured display value is appropriate.

Choose the APNs event from the token’s role

In the inspected builder, a push-to-start target produces a start payload with attributes and the declared attributes type. An existing update token receives an update when the logical item is labelled start. An end item is not sent through the push-to-start path.

The selected fixtures check those mappings and the start-alert fallback, along with selected localized phase-alert keys. Apple’s documentation separately describes start/update/end payload requirements and token handling. The local mapping cases do not establish that a real device supplied the intended token kind or accepted the resulting activity.

Keep state time, staleness and dismissal separate

The APNs payload carries a timestamp, content state and a stale date; an end event can include a dismissal date. The transport also has an expiration field. The FCM payload carries selected state/freshness values and uses different selected TTLs for ordinary and end events.

Apple distinguishes marking displayed information stale from removing an ended activity. The fixtures verify selected emitted values, not actual timing on a device. Likewise, including a sequence value does not by itself prove ordered reception, monotonic client application or timely removal after an end event.

Treat the Android message as input to native presentation

The FCM builder emits a high-priority data message with string values, serialized state/attributes and an activity collapse key. It does not emit a standard notification block in this path. The fixture checks that selected representation and the longer chosen transport lifetime for an end message.

The native app must interpret and render the message. Android’s documentation makes promotion depend on notification characteristics, permissions and user settings, with additional possible device criteria. A well-shaped FCM body is therefore not proof of a promoted Live Update, correct dismissal handling or acceptance of every proposed activity trigger.

Read provider-result field names at their observation boundary

The delivery helper reports selected invalid tokens and an aggregate sent/retry/dead result. It adds a device identifier to startedDevices when a push-to-start send returns ok through its provider abstraction. The fixture supplies that ok result without any device interaction.

That list is provider-result bookkeeping, not an acknowledgement that a native activity actually started. Actual lifecycle observation, subsequent update-token registration and device-side behaviour need separate evidence. The same distinction applies to an end payload: sending it does not demonstrate that an outdated surface has disappeared.

Make missing-provider and worker-backoff policy explicit

The live-delivery helper skips an unconfigured provider rather than automatically treating it as transient. The selected cases check no-sender, invalid-token, accepted and transient combinations. The worker source has separate backoff for selected missing-action errors and ordinary failures.

Another fixture checks reuse of the same generated provider JWT across two injected sends. It does not exercise or prove reuse of a real HTTP/2 connection. The disabled/enabled worker fixtures record tick and completion calls, without updating a real outbox or establishing current provider configuration.

Keep registration, preferences and dismissal as control operations

The route fixtures check selected Boolean preference bodies, token-kind requirements, activity-key binding, platform environment fields and dismissal identifiers before the fake database dependency. They also verify propagation of a selected feature-disabled response.

The contract-source assertion checks that routes and state names are documented. Neither that assertion nor a configuration-derived flag proves that the feature is enabled on a device or in production. Current eligibility, access changes, dismissal persistence and payload-to-widget compatibility require their own authoritative and native acceptance work.

A practical ongoing-state acceptance package

Keep selected-field, token-kind, event, alert, time-field, provider-result, route and worker fixtures. Add authoritative tests for eligibility, access loss, dismissal and stale state. Then exercise real start/update/end flows with controlled native accounts, including disconnected devices, token changes, user settings and unsupported presentation conditions.

For a CTO, the case separates event construction, transport acceptance and observed device state. The pinned implementation and ten scoped cases establish selected server-side behaviour. They do not establish current lock-screen privacy, actual promotion, timely delivery or native lifecycle correctness.

Compare the reviewed boundaries

Independent observations in ongoing activity delivery

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

BoundarySelected evidenceSeparate acceptance
State projectionSynthetic excluded markers and allowed fieldsActual display content and preview settings
Token-kind mappingStart/update/end payload fixturesReal token registration and native lifecycle
Provider outcomeInjected send results and completion objectsObserved device start/update/end
Native promotionPrimary platform criteria reviewedActual permissions, settings and device rendering

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

item = authoritative_activity_state_and_selected_targets()
for token in item.targets:
    event = map_logical_event_to_token_kind(item, token)
    payload = project_selected_state_attributes_and_freshness(item, event)
    result = send_through_configured_provider(payload)
    record_provider_observation(result)

# Provider acceptance and a reported started-device id are not native lifecycle proof.

Additional implementation references

These provider references explain current implementation context. Historical Movo-X observations remain tied to the source records described above.

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗