Skip to content

Commit 8cedb47

Browse files
rshallamV3RON
andauthored
fix: activity name being ignored when starting live activity (#116)
Fixes #115 `startLiveActivity` was sending `activityId` as the bridge key, but `StartVoltraOptions` declares `@Field activityName`. so the value was silently dropped — activities always got a random UUID instead ## Changes - Renamed `activityId` to `activityName` in the TS bridge types and call sites so the key matches Swift. - Fixed the unit test that was asserting the wrong key. ## Test plan - [x] `npm test` — unit tests pass (including corrected `activityName preserved` test) - [x] `npm run build` — type checking --------- Co-authored-by: Szymon Chmal <szymon@chmal.it>
1 parent 2661e11 commit 8cedb47

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'voltra': patch
3+
---
4+
5+
Fix iOS Live Activity naming so named activities can be reused more reliably across app launches.

packages/ios-client/src/VoltraModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
export type StartVoltraOptions = {
1212
target?: string
1313
deepLinkUrl?: string
14-
activityId?: string
14+
activityName?: string
1515
staleDate?: number
1616
relevanceScore?: number
1717
channelId?: string

packages/ios-client/src/live-activity/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const startLiveActivity = async (
185185
const targetId = await VoltraModule.startLiveActivity(payload, {
186186
target: 'liveActivity',
187187
deepLinkUrl: options?.deepLinkUrl,
188-
activityId: options?.activityName,
188+
activityName: options?.activityName,
189189
channelId: options?.channelId,
190190
...normalizedSharedOptions,
191191
})

packages/voltra/src/VoltraModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type StartVoltraOptions = {
2424
* The ID/name of the Live Activity.
2525
* Allows you to rebind to the same activity on app restart.
2626
*/
27-
activityId?: string
27+
activityName?: string
2828
/**
2929
* Unix timestamp in milliseconds
3030
*/

packages/voltra/src/live-activity/__tests__/options.node.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('Live Activity Options', () => {
111111

112112
expect(VoltraModule.startLiveActivity).toHaveBeenCalledWith(
113113
expect.anything(),
114-
expect.objectContaining({ activityId: 'my-activity' })
114+
expect.objectContaining({ activityName: 'my-activity' })
115115
)
116116
})
117117
})

packages/voltra/src/live-activity/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export const startLiveActivity = async (
280280
const targetId = await VoltraModule.startLiveActivity(payload, {
281281
target: 'liveActivity',
282282
deepLinkUrl: options?.deepLinkUrl,
283-
activityId: options?.activityName,
283+
activityName: options?.activityName,
284284
channelId: options?.channelId,
285285
...normalizedSharedOptions,
286286
})

0 commit comments

Comments
 (0)