Search code examples
apple-appclips

Why is the App Clip Code payload size limit so small


We're using App Clips and while it would be nice to use Apple's App Clip Codes, there seems to be an unusably small payload limit. Even trying to encode a relatively short URL such as the one below:

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

returns the error:

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

As a result the only way to encode anything useful is to have all parameters in a database with a reference in the URL, but this adds an additional round trip request to retrieve that data. Am I missing something?


Solution

  • From 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/.