feat: support sending "new title" alerts to devices

This commit is contained in:
2024-09-02 13:02:05 -04:00
parent ae99918524
commit 4fe22bccf3
16 changed files with 381 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ export type FcmMessagePayload = {
interface Notification {
title: string;
body: string;
image: string;
image?: string;
}
interface AndroidConfig {

View File

@@ -0,0 +1,24 @@
import { Receiver } from "@upstash/qstash";
import type { Env } from "~/types/env";
export function verifyQstashHeader(
env: Env,
signature: string | undefined,
body: string,
): Promise<boolean> {
if (!signature) {
return Promise.resolve(false);
}
const receiver = new Receiver({
currentSigningKey: env.QSTASH_CURRENT_SIGNING_KEY,
nextSigningKey: env.QSTASH_NEXT_SIGNING_KEY,
});
return receiver.verify({
body,
signature,
url: "https://aniplay-v2.rururu.workers.dev",
});
}