diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-10-21 10:03:01 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-10-21 10:03:01 -0700 |
| commit | f9490ea071fa920a77e87f094ad7bd13ead13cfa (patch) | |
| tree | 027fdef7f903d1c20d491121fcf749cf1df0e8ed | |
| parent | 81c4b758b7ee1a34c7233ded857b29d99bedafb3 (diff) | |
fix: upstash rest token removal url
| -rw-r--r-- | notifications.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/notifications.py b/notifications.py index 0ec36cb..3791f00 100644 --- a/notifications.py +++ b/notifications.py @@ -61,11 +61,10 @@ def broadcast_to_topic(topic: str, title: str, body: str, image): if not error.success: failed_token = tokens[idx] print(f"Error for token {failed_token}: {error.exception}") - url = f"{upstash_rest_api_url}/srem/fcm-{topic}" + url = f"{upstash_rest_api_url}/srem/fcm-{topic}/{failed_token}" resp = requests.post( url, - headers={"Authorization": f"Bearer {upstash_token}"}, - json={"value": failed_token} + headers={"Authorization": f"Bearer {upstash_token}"} ) if resp.status_code != 200: print(f"Failed to remove token {failed_token} from topic '{topic}': {resp.text}") |
