{"id":122194,"date":"2020-12-14T19:00:39","date_gmt":"2020-12-14T19:00:39","guid":{"rendered":"https:\/\/developer.apple.com\/news\/?id=s2j9do6a"},"modified":"2020-12-14T19:00:39","modified_gmt":"2020-12-14T19:00:39","slug":"how-to-store-urls-in-your-app-clip-codes","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2020\/12\/14\/how-to-store-urls-in-your-app-clip-codes\/","title":{"rendered":"How to store URLs in your App Clip Codes"},"content":{"rendered":"<div class=\"inline-article-image\"><img decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2020\/12\/how-to-store-urls-in-your-app-clip-codes.jpg\" data-hires=\"false\"><\/div>\n<p>An App Clip is a small part of your app which provides specific information that best suits a given task or situation. An App Clip Code activates your App Clip, helping people access relevant information wherever they happen to be \u2014 whether they\u2019re picking up takeout from a restaurant, reading an article online, or passing by an advertisement in their neighborhood.<\/p>\n<p>To make your App Clip Code, you\u2019ll need to create a URL that directly connects to your content. And because codes can only hold a finite number of characters, you\u2019ll need to design your URL efficiently. Here\u2019s what you need to know to make and store a URL for your App Clip Code.<\/p>\n<h3>How App Clip Code URLs work<\/h3>\n<p>App Clip Codes support URLs in the following format:<\/p>\n<p><code>https:\/\/[host][\/&lt;optional path&gt;][?&lt;optional query&gt;][#&lt;optional fragment&gt;]<\/code><\/p>\n<p>URLs must use the <code>https<\/code> scheme, all lowercase.<\/p>\n<p>The host segment can only contain lowercase ASCII characters \u2018a\u2019 to \u2018z\u2019, \u2018.\u2019 and \u2018-\u2019 characters. Host is the only part of the <em>authority<\/em> component of the URL that is supported.<\/p>\n<p>The rest of the URL can have zero or more path components, zero or more query components, and, optionally, a fragment component. These components can contain the following ASCII characters: <code>a<\/code> to <code>z<\/code>, <code>A<\/code> to <code>Z<\/code>, <code>0<\/code> to <code>9<\/code>, and <code>\/#?=%-._,+;:&amp;<\/code>.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/app_clips\/creating_app_clip_codes\" class=\"icon icon-after icon-chevronright\">Learn more about creating App Clip Codes<\/a><\/p>\n<h3>How to store URLs efficiently in your App Clip Codes<\/h3>\n<p>When creating a URL, you can optimize its string length to fit within the App Clip Code\u2019s character limit in a number of different ways.<\/p>\n<p><strong>Make it short and sweet<\/strong><br \/>\nAbove all, aim for your URLs to be as short and concise as possible. URLs with fewer characters, path, and query components have a better chance to fit into an App Clip Code.<\/p>\n<p>We recommend using a short host name with as few subdomains as possible, as well as removing the <em>www<\/em> subdomain whenever possible. You\u2019ll also want to omit a trailing \u2018\/\u2019 character from the end of the URL if possible. For instance, <code>https:\/\/www.example.com\/<\/code> can be changed to <code>https:\/\/example.com<\/code>.<\/p>\n<p>If you do plan to use a subdomain, consider using <code>appclip<\/code> to define App Clip-specific URLs for App Clip Codes. This special subdomain is compressed efficiently and it allows URLs to have short path and query components by eliminating the possibility of a conflict with an unrelated functionality of your website. <\/p>\n<p>While adding this subdomain is optional, if you do opt to use it, it must appear as the first subdomain of the URL\u2019s host, like so: <code>https:\/\/appclip.example.com<\/code>.<\/p>\n<p><strong>Optimize for compression<\/strong><br \/>\nConsider using the minimum number of characters needed to uniquely identify a resource in your URLs, as long UUIDs will lower the effectiveness of the compression.<\/p>\n<p>In addition, replace long query string argument names and values with short names and values to aid in compression. For example, you can turn argument names into shorter names and values into an enum, like so: <code>https:\/\/example.com\/?status=view<\/code> could be restructured as <code>https:\/\/example.com\/?p=0<\/code>.<\/p>\n<p>Using decimal numbers as query parameter values may also lead to better compression of the URL.<\/p>\n<p><strong>Choose your words carefully<\/strong><br \/>\nApp Clip Codes offer more effective URL encoding for certain words in the URL path component, like <code>account<\/code>, <code>app<\/code>, <code>download<\/code>, <code>shop<\/code>, <code>upload<\/code>, <code>visit<\/code>, and more. Consider using these whenever possible to improve your encoding and compression. You can view the full list of words within Apple\u2019s documentation.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/app_clips\/creating_app_clip_codes\/encoding_a_url_in_an_app_clip_code\" class=\"icon icon-after icon-chevronright\">Learn more about encoding a URL in an App Clip Code<\/a><\/p>\n<p>In addition, a URL that contains zero or one path component from the list of special words and contains zero or more query components with ordered argument names p, p1, p2, and the like has a higher likelihood of fitting in an App Clip Code. Some examples:<\/p>\n<p><code>https:\/\/appclip.example.com\/shop<\/code><br \/>\n<code>https:\/\/appclip.example.com\/shop?p=123<\/code><br \/>\n<code>https:\/\/appclip.example.com\/?p=123<\/code><br \/>\n<code>https:\/\/appclip.example.com\/?p=123&amp;p1=4632<\/code><\/p>\n<h3>Resources<\/h3>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/app_clips\/creating_app_clip_codes\/creating_app_clip_codes_with_app_store_connect\" class=\"icon icon-after icon-chevronright\">Learn more about creating App Clip Codes in App Store Connect<\/a><\/p>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/app_clips\/creating_app_clip_codes\/creating_app_clip_codes_with_the_app_clip_code_generator\" class=\"icon icon-after icon-chevronright\">Learn how to generate App Clip Codes<\/a><\/p>\n<section class=\"grid activity\">\n<section class=\"row\">\n<section class=\"column large-4 small-4 no-padding-top no-padding-bottom\"> <a href=\"https:\/\/developer.apple.com\/wwdc20\/10174\" class=\"activity-image-link\"> <img decoding=\"async\" class=\"actiity-image medium-scale\" width=\"250\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2020\/12\/how-to-store-urls-in-your-app-clip-codes-1.jpg\" data-hires=\"false\" alt> <\/a> <\/section>\n<section class=\"column large-8 small-8 padding-left-small padding-top-small padding-bottom-small no-padding-top no-padding-bottom\"> <a href=\"https:\/\/developer.apple.com\/wwdc20\/10174\"> <\/p>\n<h4 class=\"no-margin-bottom activity-title\">Explore App Clips<\/h4>\n<p> <\/a> <\/p>\n<p class=\"activity-description\">Help people experience the right parts of your app at the exact moment they need them. We\u2019ll explain how to design and build an App Clip \u2014 a small part of your app that focuses on a specific task \u2014 and make it easily discoverable. Learn how to focus your App Clip on short and fast&#8230;<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"grid activity\">\n<section class=\"row\">\n<section class=\"column large-4 small-4 no-padding-top no-padding-bottom\"> <a href=\"https:\/\/developer.apple.com\/wwdc20\/10146\" class=\"activity-image-link\"> <img decoding=\"async\" class=\"actiity-image medium-scale\" width=\"250\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2020\/12\/how-to-store-urls-in-your-app-clip-codes-2.jpg\" data-hires=\"false\" alt> <\/a> <\/section>\n<section class=\"column large-8 small-8 padding-left-small padding-top-small padding-bottom-small no-padding-top no-padding-bottom\"> <a href=\"https:\/\/developer.apple.com\/wwdc20\/10146\"> <\/p>\n<h4 class=\"no-margin-bottom activity-title\">Configure and link your App Clips<\/h4>\n<p> <\/a> <\/p>\n<p class=\"activity-description\">App Clips are small parts of an app that offer a streamlined, direct experience and help people get what they need at the right time. Learn how you can invoke an App Clip through real-world experiences like App Clip Codes, NFC, and QR codes, or have them appear digitally through apps like Maps or&#8230;<\/p>\n<\/section>\n<\/section>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>An App Clip is a small part of your app which provides specific information that best suits a given task or situation. An App Clip Code activates your App Clip, helping people access relevant information wherever they happen to be \u2014 whether they\u2019re picking up takeout from a restaurant, reading an article online, or passing [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":122195,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-122194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple-developer-news"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/122194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=122194"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/122194\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/122195"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=122194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=122194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=122194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}