Ends a specific order tracking live notification.
Dismisses the live notification from the user's lock screen and Dynamic Island. The notification is removed immediately.
Platform Support: iOS 16.2+ and Android 16 (API 36)+. Throws error on unsupported platforms.
Example:
const modules = await Eitri.modules()
const liveNotificationEnd = modules.orderStatusLiveNotification?.end
if (!liveNotificationEnd) return
try {
await liveNotificationEnd({
orderId: "12345"
})
console.log("Live notification ended successfully")
} catch (error) {
console.error("Failed to end live notification:", error)
}
Object containing the orderId to end
Promise that resolves when the live notification is dismissed
Ends all active order tracking live notifications for the current user.
Dismisses all live notifications associated with the app, regardless of order ID. Useful for cleanup operations like user logout.
Platform Support: iOS 16.2+ and Android 16 (API 36)+. No-op on unsupported platforms.
When to call:
Example:
// Clear all live notifications on logout
async function handleLogout() {
const modules = await Eitri.modules()
const liveNotificationEndAll = modules.orderStatusLiveNotification?.endAll
if (liveNotificationEndAll) {
await liveNotificationEndAll()
}
// Continue with logout flow...
}
Promise that resolves when all live notifications are dismissed
Retrieves information about all currently active order tracking live notifications.
Returns a list of all live notifications currently displayed for the user, including their order IDs and activity IDs.
Platform Support: iOS 16.2+ and Android 16 (API 36)+. Returns empty array on unsupported platforms.
Use cases:
Example:
const modules = await Eitri.modules()
const liveNotificationGetActiveNotifications = modules.orderStatusLiveNotification?.getActiveNotifications
if (!liveNotificationGetActiveNotifications) return
const activities = await liveNotificationGetActiveNotifications()
console.log(`${activities.length} active order notifications`)
activities.forEach(activity => {
console.log(`Order ${activity.orderId} - Activity ${activity.activityId}`)
})
// Check if specific order is being tracked
const isTracking = activities.some(a => a.orderId === "12345")
Promise resolving to array of active live notification info. Empty array if none active.
Checks if order tracking live notifications are supported on the current device.
This method verifies:
Platform Support: Returns false on iOS < 16.2 and Android < 16.
Permissions: A supported device does not imply the OS notification permission is granted.
Validate it separately with Eitri.notification.checkPermission() (and request it with
Eitri.notification.requestPermission()) before calling start. See the
Notification API reference.
Example:
const modules = await Eitri.modules()
const liveNotificationIsSupported = modules.orderStatusLiveNotification?.isSupported
if (!liveNotificationIsSupported) return
const supported = await liveNotificationIsSupported()
if (!supported) {
console.log("Live notifications not available on this device")
// Fallback to push notifications or in-app updates
}
Promise resolving to true if live notifications are available, false otherwise.
Starts a new order tracking live notification for the specified order.
Creates a live notification (an iOS Live Activity, or an Android 16+ Live Update) that displays on the user's lock screen / Dynamic Island (iOS) or status bar chip / lock screen (Android), showing real-time order status updates.
Platform Support: iOS 16.2+ and Android 16 (API 36)+. Throws error on unsupported platforms.
Permissions: Live notifications require the OS notification permission. This module does not
request it for you — call Eitri.notification.requestPermission() before calling start and
proceed only when its status is "GRANTED". Calling start without the permission granted will
not display a notification. (Use Eitri.notification.checkPermission() for read-only UI state,
e.g. enabling/disabling a button — not as the gate before start, since on Android a blocked
permission is only revealed by a request.) See the
Notification API reference.
Important:
orderId can be activeorderId, returns existing activity infoExample:
const modules = await Eitri.modules()
const liveNotificationStart = modules.orderStatusLiveNotification?.start
if (!liveNotificationStart) return
// Ensure the OS notification permission is granted before starting.
const permission = await Eitri.notification.requestPermission()
if (permission.status !== "GRANTED") return // user declined; do not start
try {
const result = await liveNotificationStart({
orderId: "12345",
orderIdDisplayText: "Order #ORD-12345",
storeName: "Test Store",
status: {
displayName: "Confirmed",
icon: "checkmark.circle",
progress: 0.25
},
message: "Your order has been confirmed",
estimatedTime: "30 min"
})
console.log("Live notification started:", result.activityId)
} catch (error) {
console.error("Failed to start live notification:", error)
}
Configuration for the live notification
Promise resolving to activity information including activityId and orderId
Updates an existing order tracking live notification with new status information.
Updates the live notification on the user's lock screen and Dynamic Island with new order status, progress, message, and estimated time.
Platform Support: iOS 16.2+ and Android 16 (API 36)+. Throws error on unsupported platforms.
Update Methods:
Live notifications can be updated in two ways:
On iOS, starting a live notification registers a per-activity push token with APNs. On Android,
the server reuses the app's existing FCM device token and addresses updates by orderId.
Either way the Eitri server can send remote updates, allowing the live notification to update
even when the app is not running.
Common Update Scenarios:
Example (update to preparing):
const modules = await Eitri.modules()
const liveNotificationUpdate = modules.orderStatusLiveNotification?.update
if (!liveNotificationUpdate) return
try {
await liveNotificationUpdate({
orderId: "12345",
status: {
displayName: "Preparing",
icon: "flame",
progress: 0.5
},
message: "Your order is being prepared",
estimatedTime: "25 min"
})
} catch (error) {
console.error("Failed to update live notification:", error)
}
Example (update to out for delivery):
const modules = await Eitri.modules()
const liveNotificationUpdate = modules.orderStatusLiveNotification?.update
if (!liveNotificationUpdate) return
await liveNotificationUpdate({
orderId: "12345",
status: {
displayName: "Out for delivery",
icon: "truck.box",
progress: 0.75
},
message: "Your order is on it's way",
estimatedTime: "10 min"
})
Example (update to delivered):
const modules = await Eitri.modules()
const liveNotificationUpdate = modules.orderStatusLiveNotification?.update
if (!liveNotificationUpdate) return
await liveNotificationUpdate({
orderId: "12345",
status: {
displayName: "Delivered",
icon: "checkmark.circle.fill",
progress: 1.0
},
message: "Your order has been delivered",
})
Updated order status information
Promise that resolves when the update is complete
Functions that allow an Eitri-App to create and manage order tracking live notifications.
Live notifications display real-time order status updates on the lock screen and Dynamic Island, providing users with at-a-glance information about their order progress without opening the app.
Platform Support:
Important Notes:
orderIdcan be active at a time