Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): dismiss ended Live Activities on foreground #12656

ClosedEMOEMOJAI(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/12656/headopened View on GitHub

Showing 6 changed files with 189 additions and 0 deletions (loading 2).

x
0 of 6 viewed, 6 left
7 additions and 0 deletionsapps/mobile/src/features/agent-awareness/agentLiveActivity.ios.tsModified
View file
@@ -1,9 +1,16 @@
import AgentActivity, { type AgentActivityProps } from "../../widgets/AgentActivity";
​
+/** Dismisses ended T3 cards still visible on the Lock Screen, preserving active and stale cards. */
+export function dismissEndedAgentLiveActivities(): Promise<void> {
+ return AgentActivity.dismissEndedInstances();
+}
+​
+/** Returns active and stale T3 cards; ended cards require the separate native dismissal pass. */
export function getAgentLiveActivities() {
return AgentActivity.getInstances();
}
​
+/** Starts a T3 card while the app is foregrounded so its update token can be registered. */
export function startAgentLiveActivity(props: AgentActivityProps) {
return AgentActivity.start(props);
}
7 additions and 0 deletionsapps/mobile/src/features/agent-awareness/agentLiveActivity.tsModified
View file
@@ -1,10 +1,17 @@
import type { LiveActivity } from "expo-widgets";
import type { AgentActivityProps } from "../../widgets/AgentActivity";
​
+/** Resolves without native work on platforms that do not support iOS Live Activities. */
+export function dismissEndedAgentLiveActivities(): Promise<void> {
+ return Promise.resolve();
+}
+​
+/** Returns no cards on platforms without iOS Live Activity support. */
export function getAgentLiveActivities(): Array<LiveActivity<AgentActivityProps>> {