How Hema Integrated iOS Live Activities and Huawei HarmonyOS Real‑Time Notifications for Delivery & Dining
This article details Hema's technical implementation of iOS Live Activities and Huawei HarmonyOS real‑time notifications across delivery and in‑store dining scenarios, covering background, deployment timeline, notification content design, integration steps, push token handling, activity ID generation, UI adaptations, edge‑case handling, and future expansion plans.
Background
Hema partnered with Apple to support iOS Live Activities and Dynamic Island in delivery and dining scenarios, gaining brand exposure and user recognition. The same concept was later explored on Huawei's HarmonyOS 4.0 with its "Real‑time Window" feature, prompting collaboration with Huawei product and R&D teams.
Deployment Scenarios
Hema was among the first third‑party apps, alongside Meituan and others, to support HarmonyOS 4 Real‑time Window. Development began in July using Huawei's beta Real‑time Notification API, with a public launch before the Huawei Developer Conference in August and full service opening at the end of August.
Version 5.73.0 of the Hema app introduced live delivery notifications, achieving click‑through rates dozens of times higher than regular push messages. As HarmonyOS 4 adoption grows, the impact is expected to increase.
Order Delivery
Previously, users had to open the app to check order status. Real‑time notifications now display delivery status directly on the lock screen and in the notification capsule.
In‑Store Dining
When customers order in‑store, they previously needed to ask staff for progress. Real‑time notifications now push dish preparation updates to the lock screen.
Technical Solution
Technical Flow
General Real‑time Notification Process
Integrate the Push Android SDK to obtain a PushToken.
Create a local real‑time notification and report the data and token to the app server.
The app server sends a refresh request to the Push server, updating the notification content.
Hema Business Process
The workflow involves multiple teams: H5 front‑end checks device support and creates the notification via JSBridge; the native side integrates Huawei Push SDK and reports order ID, device token, and notification ID; the message server maps orders to notification cards and forwards status changes from business services; transaction and fulfillment services trigger card updates for payment, packaging, dispatch, and completion.
Key Technical Points
PushToken Acquisition and Update
Hema uses Alibaba's unified Agoo push platform. The AccsSDK wrapper hides Huawei PushToken APIs, so custom hacks call getToken during initialization and refresh the token via onNewToken, exposing a global method to avoid excessive token requests.
Notification Creation Timing
For instant delivery, the optimal moment is after payment; for in‑store dining, it is after scanning the payment QR code. Both paths converge on the payment success page, requiring a JSBridge to determine system support and create the notification.
Live Activity ID Generation
Android apps call NotificationManager.notify with a unique ID. Hema uses the order number as the activityId. Delivery orders use the main order number, while dining orders generate an ID per dish (sub‑order) to reflect individual preparation status.
Auxiliary Area Content Update
Because Huawei limits auxiliary content to 44×44 vp and does not support remote images, Hema downloads images via the Phenix library (static images) or extracts the first frame of GIFs, converts them to Bitmaps, and updates the auxiliary area through native APIs.
Experience Optimizations
Delivery Order Constraints
Only O2O fresh‑goods orders (excluding cloud‑super, membership stores, NB) of normal type.
Orders must contain delivery info and have a fulfillment time ≤ 8 hours after payment.
Edge Cases
Close notifications if fulfillment exceeds 2 hours or a reverse flow interrupts the order.
Filter duplicate notifications caused by memory‑recovery after payment page exit.
Exclude orders split for the Shenzhen plastic‑reduction fee.
Capsule Adaptation
Enable scrolling text for long messages.
Use Hema blue as background.
Prefer three‑character titles for optimal display.
Future Outlook
Further Experience Details
Incorporate weather information into delivery notifications to reduce negative sentiment.
Support scheduled deliveries (future‑time notifications) once Huawei adds the capability.
Improve dining pick‑up code refresh latency and prioritize real‑time messages over push, SMS, and calls.
Additional Scenario Expansion
Explore new use cases such as limited‑time product launches, recipe reminders, OMS integration, and lifestyle services.
Extend notifications to other devices like Huawei watches and car displays for richer touchpoints.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
