Skip to content

Commit 7653507

Browse files
authored
Merge pull request #15 from Zwyx/patch-1
Add support for `categoryIdentifier` and `subtitle`
2 parents b827167 + e54bc72 commit 7653507

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/component/internal.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ export const coordinateSendingPushNotifications = internalMutation({
145145
return {
146146
message: {
147147
to: n.token,
148-
sound: n.metadata.sound ?? "default",
149148
title: n.metadata.title,
149+
subtitle: n.metadata.subtitle ?? undefined,
150150
body: n.metadata.body ?? undefined,
151+
sound: n.metadata.sound ?? "default",
151152
data: n.metadata.data ?? undefined,
153+
categoryIdentifier: n.metadata.categoryIdentifier ?? undefined,
152154
},
153155
_id: n._id,
154156
};
@@ -193,10 +195,12 @@ export const action_sendPushNotifications = internalAction({
193195
v.object({
194196
message: v.object({
195197
to: v.string(),
196-
sound: v.string(),
197198
title: v.string(),
199+
subtitle: v.optional(v.string()),
198200
body: v.optional(v.string()),
201+
sound: v.string(),
199202
data: v.optional(v.any()),
203+
categoryIdentifier: v.optional(v.string()),
200204
}),
201205
_id: v.id("notifications"),
202206
})

src/component/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { ObjectType, v } from "convex/values";
33

44
export const notificationFields = {
55
title: v.string(),
6+
subtitle: v.optional(v.string()),
67
body: v.optional(v.string()),
78
sound: v.optional(v.string()),
89
data: v.optional(v.any()),
10+
categoryIdentifier: v.optional(v.string()),
911
};
1012

1113
export type NotificationFields = ObjectType<typeof notificationFields>;

0 commit comments

Comments
 (0)