Live Activity Refresh Delay
Nucleic-Session: 8C954A45-A16B-4E91-B9E6-9865809096D7 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -98,6 +98,7 @@ export async function registerPushToken(
|
||||
if (!body?.deviceId || !body.token) return new Response("deviceId and token required", { status: 422 });
|
||||
const apsEnv = body.env === "production" ? "production" : "sandbox";
|
||||
const record: PushTokenRecord = { token: body.token, env: apsEnv, hostId };
|
||||
if (body.topic) record.topic = body.topic;
|
||||
await kv.put(body.deviceId, JSON.stringify(record), { expirationTtl: PUSH_TOKEN_TTL });
|
||||
const auth = await kv.get(`hostauth:${hostId}`);
|
||||
if (auth) await kv.put(`hostauth:${hostId}`, auth, { expirationTtl: HOST_AUTH_TTL });
|
||||
|
||||
Reference in New Issue
Block a user