为什么 App Clip 代码负载大小限制这么小

Why is the App Clip Code payload size limit so small

我们正在使用 App Clips,虽然使用 Apple 的 App Clip 代码会很好,但负载限制似乎小得无法使用。甚至尝试编码一个相对较短的 URL,如下所示:

AppClipCodeGenerator generate --url 'https://www.example.com/1234567890ABCD' --index 8 --output ./appclip8.svg 

returns错误:

Compressed URL too large: The compressed URL byte size exceeds supported payload size of the App Clip Code.

因此,对任何有用的内容进行编码的唯一方法是将所有参数保存在数据库中并在 URL 中进行引用,但这会增加额外的往返请求以检索该数据。我错过了什么吗?

来自Apple

An App Clip Code can only contain a limited amount of information, and as a result, the tools you use to create the code compress the encoded invocation URL. The underlying encoding algorithm can encode some words efficiently, while some characters may reduce the algorithm’s efficiency. As a result, the exact length of an invocation URL you can encode in an App Clip Code varies based on the ASCII characters and words you use.

When you create an App Clip Code, both App Store Connect and the App Clip Code Generator command-line tool inform you if your invocation URL is too long.

To ensure you can encode your invocation URL in an App Clip Code:

Use the minimum number of characters you need to uniquely identify a resource. Long unique identifiers (UUIDs) lower the effectiveness of the encoding.

Use a short host name with as few subdomains as possible.

If possible, remove the www subdomain from your host name.

Use decimal numbers as values for query components.

Replace long query string argument names and values with short strings. For example, use https://example.com/?p=0 instead of https://example.com/?status=view.

Omit a trailing slash (/) character at the end of the URL. For example, use https://example.com instead of https://example.com/.