Version: 2021.2
macOS 播放器:适用于 IL2CPP 的 C++ 源代码插件
Delivering your macOS application

Deep linking on macOS

Deep links are URL links outside of your application that direct users to a location in your application. When the user clicks a deep link for an application, the operating system opens the Unity application at a specified place (for example, a specific scene). For more information about deep links and how to use them, see Deep links.

Enabling deep linking for macOS applications

Before you can process deep links, you need to configure your application to react to them. This section contains instructions on how set up deep links for macOS.

There are two ways to enable deep linking for macOS applications: URL schemes and universal links.

URL 方案

A URL scheme specifies a link structure that your iOS application reacts to. If the device processes a deep link that matches this structure, the device opens your application. To add a URL scheme:

  1. Open the Standalone Player Settings window (menu: Edit > Project Settings > Player Settings, then select Windows, Mac, Linux settings).
  2. 选择 Other,然后向下滚动到 Configuration
  3. Expand the Supported URL schemes section and, in the Element 0 field, enter the URL scheme to associate with your application. For example, unitydl.

Your macOS application now opens when the device processes any link that starts with unitydl://.

通用链接

For information on how to enable universal links, see Apple’s documentation on Allowing Apps and Websites to Link to Your Content.

Using deep linking on macOS

After you enable deep links for macOS, the way that you use them is platform-agnostic. For information on how to handle deep links when your application opens, see Using deep links.

macOS 播放器:适用于 IL2CPP 的 C++ 源代码插件
Delivering your macOS application