[GH-ISSUE #1237] Wherer i can find this param "subscription_id" ? #876

Closed
opened 2026-05-07 00:28:23 +02:00 by BreizhHardware · 1 comment

Originally created by @katfionn on GitHub (Dec 11, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1237

Question
where i can find subscription_id?

Detail

I note that sw.js in official demo got this:

const handlePushMessage = async (data) => {
  const { subscription_id: subscriptionId, message } = data;

  await self.registration.showNotification(message.topic, {
    body: message.body,
    icon: "/icon.png",
    badge: "/badge.png",
  });
};

But when i print the log in console after subscrib with websocket, here's the response i got. There's no such thing call subscription_id.

{
   "actions": [
      {
         "action": "view",
         "clear": true,
         "id": "Lmq5KevWsu",
         "label": "查看文章",
         "url": "https://71.gold/?post=69665"
      },
      {
         "action": "view",
         "clear": true,
         "id": "xn4Ur47Dkt",
         "label": "访问首页",
         "url": "https://71.gold/"
      }
   ],
   "attachment": {
      "name": "阿里云盘4K影视.webp",
      "url": "https://source.71.gold/img/阿里云盘4K影视.webp"
   },
   "content_type": "text/markdown",
   "event": "message",
   "expires": 1733920817,
   "id": "lVf6uucYIFi7",
   "message": "1、[🖼 名称:自由职业者 (2023) 4K 中英外挂字幕 描述:一名前特种部队特工在记者采访独裁者时接受了一份为她提供安全保障的工作,但当采访过程中爆发军事政变时...](https://t.me/Aliyun_4K_Movies/29392) —— 2024-12-11 08:31:02 \n\n![](https://cdn1.cdn-telegram.org/file/HebvhIlRXJxf9N2QKNLe1x9U0pUXkKuKvCoR8Ut_0jewJnP81WYj78zvtmGljiAk1FHGuw1OKdeuDvzpnp0Kzz6t4TpQUZrwiZ3KNhCtNaMSJ5iBeruPVk4kZspsp59TTuXfxpXPw_q3xnf8z3OMltckmWSH4UoIkyE6a5p4RKm9CMWZ9wlXSiUBqiXr5VAYEIDUI6wuFBhhXmNZbb1QKSJ2knQkx17jvQtL332zA2pK4uvwqul81SPYz-B8_ZRyX6-48vnQyy-GOBmzjOQ2TJXIcEAa9vMMCLuiVbyEf72GnJnTH1h2idk-4JWdC5RGbN-p22BhA-IL5SQ3HsTP0g.jpg)",
   "priority": 3,
   "time": 1733877617,
   "title": "🎞影音大全有新资讯了",
   "topic": "YJr3F1HNZXDs1fzCAltAdVQIz-HC-xVvnYQYnLul_oI"
}

I don't have any experience or bacsic knowledge about Javascript, All my code are relied on AI, so any help or instructions will be greatful.

Originally created by @katfionn on GitHub (Dec 11, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1237 <!-- Before you submit, consider asking on Discord/Matrix instead. You'll usually get an answer sooner, and there are more people there to help! - Discord: https://discord.gg/cT7ECsZj9w - Matrix: https://matrix.to/#/#ntfy:matrix.org / https://matrix.to/#/#ntfy-space:matrix.org --> :question: **Question** where i can find `subscription_id`? **Detail** I note that sw.js in official demo got this: ```Javascript const handlePushMessage = async (data) => { const { subscription_id: subscriptionId, message } = data; await self.registration.showNotification(message.topic, { body: message.body, icon: "/icon.png", badge: "/badge.png", }); }; ``` But when i print the log in console after subscrib with websocket, here's the response i got. There's no such thing call `subscription_id`. ```JSON { "actions": [ { "action": "view", "clear": true, "id": "Lmq5KevWsu", "label": "查看文章", "url": "https://71.gold/?post=69665" }, { "action": "view", "clear": true, "id": "xn4Ur47Dkt", "label": "访问首页", "url": "https://71.gold/" } ], "attachment": { "name": "阿里云盘4K影视.webp", "url": "https://source.71.gold/img/阿里云盘4K影视.webp" }, "content_type": "text/markdown", "event": "message", "expires": 1733920817, "id": "lVf6uucYIFi7", "message": "1、[🖼 名称:自由职业者 (2023) 4K 中英外挂字幕 描述:一名前特种部队特工在记者采访独裁者时接受了一份为她提供安全保障的工作,但当采访过程中爆发军事政变时...](https://t.me/Aliyun_4K_Movies/29392) —— 2024-12-11 08:31:02 \n\n![](https://cdn1.cdn-telegram.org/file/HebvhIlRXJxf9N2QKNLe1x9U0pUXkKuKvCoR8Ut_0jewJnP81WYj78zvtmGljiAk1FHGuw1OKdeuDvzpnp0Kzz6t4TpQUZrwiZ3KNhCtNaMSJ5iBeruPVk4kZspsp59TTuXfxpXPw_q3xnf8z3OMltckmWSH4UoIkyE6a5p4RKm9CMWZ9wlXSiUBqiXr5VAYEIDUI6wuFBhhXmNZbb1QKSJ2knQkx17jvQtL332zA2pK4uvwqul81SPYz-B8_ZRyX6-48vnQyy-GOBmzjOQ2TJXIcEAa9vMMCLuiVbyEf72GnJnTH1h2idk-4JWdC5RGbN-p22BhA-IL5SQ3HsTP0g.jpg)", "priority": 3, "time": 1733877617, "title": "🎞影音大全有新资讯了", "topic": "YJr3F1HNZXDs1fzCAltAdVQIz-HC-xVvnYQYnLul_oI" } ``` I don't have any experience or bacsic knowledge about `Javascript`, All my code are relied on `AI`, so any help or instructions will be greatful.
BreizhHardware 2026-05-07 00:28:23 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@binwiederhier commented on GitHub (Feb 2, 2026):

The subscription iD is an internal parameter not exposed in the message. I believe you are asking for programming support. You may join the Discord and we may be able to help, but likely this is a little off topic.

<!-- gh-comment-id:3834196070 --> @binwiederhier commented on GitHub (Feb 2, 2026): The subscription iD is an internal parameter not exposed in the message. I believe you are asking for programming support. You may join the Discord and we may be able to help, but likely this is a little off topic.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#876
No description provided.