dongman2721 2017-01-12 00:06
浏览 59
已采纳

从Safari显示器启动的应用程序:是否要允许此页面打开“(空)”?

I am writing a Mac OS app in Go/Objective-C. Suffice it to say, I am not using Xcode and have assembled the application bundle by hand. Here is what it's filesystem hierarchy looks like

${APPNAME}.app
  Contents
    MacOS
      ${APPNAME} (binary)
  Resources
    Base.lproj
      InfoPlist.strings (text)
  Info.plist (text)

The bundle launches fine. Application works as expected. I have a CFBundleURLTypes dictionary in my Plist file which defines a URL scheme for my application.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>${APPNAME}</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>zzz</string>
        </array>
    </dict>
</array>

(Note: ${APPNAME} is something like "MyApp." It is not a Java-style, reverse DNS name string.)

When I click on a link in Safari that uses the zzz:// scheme, I get a message that says:

Do you want to allow this page to open "(null)"?

Why is that? I have defined my application name in both the Info.plist file and in the InfoPlist.strings file.

The InfoPlist.strings file simply contains this:

CFBundleName = "My Wonderful Application"
  • 写回答

1条回答 默认 最新

  • dongnanbi4942 2017-01-16 20:23
    关注

    There apparently was some sort of caching mechanism happening. When deployed to another Mac system we managed to procure, which never had the software in question installed on it, this problem did not occur.

    Note: The previous system which behaved erroneously had, at the beginning of each test, the software completely removed from it. Finder, Safari or some other Apple software must have secretly cached the app name as "(null)".

    Answer: Install it on a new Mac machine, or completely restore (with no backup) the machine you are testing with.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)