Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

内置「发给 WorkBuddy」入口因 bundle id 写错而显示"未安装"

Open Beginner friendly
#44 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
desktop

Research direction

The wrong bundle identifier is hard-coded in two places: the workBuddy case of AgentID in macos/Sources/WeChatBridgeCore/AgentID.swift, and the targetBundleIdentifier switch in macos/Sources/WeChatBridgeCore/ShareAction.swift. Confirm the installed app's real id with defaults read on its Info.plist, then update both cases to that value. Done means both lookups return the corrected id and the entry no longer reports 'not installed' when WorkBuddy is present.

Written by the indexing model from the issue text.

Description

现象 / Symptom
在 macOS 上安装官方 WorkBuddy(/Applications/WorkBuddy.app)后,微信流的转发入口「发给 WorkBuddy」仍显示为橙色「未安装」,开启后转发也无法定位到 App,最终回退到剪贴板并提示「这台 Mac 上没有找到 WorkBuddy」。
复现 / Reproduction
从腾讯官方下载并安装 WorkBuddy for Mac(bundle id:com.workbuddy.workbuddy)。
打开微信流的「设置 → 入口」,查看「发给 WorkBuddy」一行 —— 显示为「未安装」。
在微信多选聊天记录 → 合并转发 → 选「发给 WorkBuddy」→ 实际只把文件放到剪贴板,并提示未找到 App。
根因 / Root Cause
AgentID.workBuddy 与 ShareAction.workBuddy.targetBundleIdentifier 把 WorkBuddy 的 bundle id 写死成了 com.tencent.workbuddy.mac:
macos/Sources/WeChatBridgeCore/AgentID.swift
case .workBuddy: return "com.tencent.workbuddy.mac"
macos/Sources/WeChatBridgeCore/ShareAction.swift 的 targetBundleIdentifier
case .workBuddy: return "com.tencent.workbuddy.mac"
而实际安装的 WorkBuddy for Mac 的 CFBundleIdentifier 是 com.workbuddy.workbuddy(已在本机 defaults read /Applications/WorkBuddy.app/Contents/Info.plist CFBundleIdentifier 验证)。
转发时 AutoPaste.applicationURL(forBundleIdentifier:) 走的是 NSWorkspace.urlForApplication(withBundleIdentifier:),该方法是精确匹配、无按名称回退,于是返回 nil → ActionRunner.forward 走 fallBack 分支 → 入口判定为未安装。
修复建议 / Suggested Fix
把上述两处都改为真实的 bundle id com.workbuddy.workbuddy:
// macos/Sources/WeChatBridgeCore/AgentID.swift
case .workBuddy:

  • return "com.tencent.workbuddy.mac"
  • return "com.workbuddy.workbuddy"

// macos/Sources/WeChatBridgeCore/ShareAction.swift (targetBundleIdentifier)
case .workBuddy:

  • return "com.tencent.workbuddy.mac"
  • return "com.workbuddy.workbuddy"
    (如后续 WorkBuddy 存在多个分发渠道、bundle id 不统一,也可改为同时尝试多个候选 id 的容错逻辑,但当前单值修正即可解决绝大多数用户问题。)
    临时绕过 / Workaround(无需等发版)
    用户可暂用「自定义目标」:微信流 → 设置 → 入口 → 添加应用 → 选中 /Applications/WorkBuddy.app,其会读取真实 id com.workbuddy.workbuddy,转发时选「发送到自定义」即可正常工作。
    环境 / Environment
    macOS 15 (Sequoia)
    WeChatBridge 0.1.15
    WorkBuddy for Mac: bundle id com.workbuddy.workbuddy
Dominant language
Swift
Stars
1.4k
Forks
430
Avg merge
18h 9m
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from freestylefly/WeChatBridge

All issues in freestylefly/WeChatBridge

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.