[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: notification groupiing

+20
+20
utils/push.ts
··· 260 260 261 261 // Add platform-specific options 262 262 if (token.platform === "ios") { 263 + const threadId = this.getThreadId(payload); 263 264 message.message.apns = { 264 265 headers: { 265 266 "apns-priority": "10", ··· 268 269 aps: { 269 270 sound: "default", 270 271 badge: badgeCount, 272 + "thread-id": threadId, 271 273 }, 272 274 }, 273 275 }; 274 276 } else if (token.platform === "android") { 277 + const threadId = this.getThreadId(payload); 275 278 message.message.android = { 276 279 priority: "high", 280 + notification: { 281 + tag: threadId, 282 + }, 277 283 }; 278 284 } 279 285 ··· 503 509 const base64 = btoa(String.fromCharCode(...data)); 504 510 return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); 505 511 } 512 + 513 + private getThreadId(payload: PushPayload): string { 514 + if (payload.reason === "follow") { 515 + return "follows"; 516 + } 517 + if (payload.reasonSubject) { 518 + return payload.reasonSubject; 519 + } 520 + return payload.recordUri; 521 + } 506 522 } 507 523 508 524 // FCM message types ··· 516 532 data: Record<string, string>; 517 533 android?: { 518 534 priority: string; 535 + notification?: { 536 + tag?: string; 537 + }; 519 538 }; 520 539 apns?: { 521 540 headers: Record<string, string>; ··· 526 545 "interruption-level"?: string; 527 546 "relevance-score"?: number; 528 547 "mutable-content"?: number; 548 + "thread-id"?: string; 529 549 }; 530 550 }; 531 551 };