You'll need to put your playgrounds online so learners can download the playground books that make up your subscription. Uploading files usually involves a web host, which is a service provider that specializes in making data available online.
Almost any web host meets the requirements for putting a playground subscription online. However, the host must support TLS 1.3 encryption. You store a subscription’s playgrounds (zipped
.playgroundbook files) as well as its feed (a JSON file) and supporting resources on the web host.
Be sure to note the URLs that your web host uses to store each file; you'll use these to fill in the parts of the feed format described in Subscription Feed Format with URLs customized to your specific web host and your playground subscription. These URLs should match up with the URLs in the feed JSON.
Some web hosts have a file upload facility that lets you drag and drop a hierarchy of directories and files from your local filesystem. When writing the JSON for a feed, it can be helpful to compare the structure of your feed’s files with the structure of the URLs in the feed.
Building a Landing Page for Your Playgrounds
If you have an existing personal, business, or school website, you can add a page to that site linking visitors to your Swift Playgrounds subscriptions.
To add a link to your feed, you'll need two pieces of information:
The URL for your subscription's JSON feed. For example:
The Swift Playgrounds universal link prefix:
Combine the two URLs to form a link on your site. The example below shows a HTML link surrounded by a descriptive sentence:
Check out my
Swift Playgrounds subscription series
that whimsically highlights interesting facets of Swift!
Localizing a Feed
You can provide localizations of your subscription content by first linking to a supplemental JSON object that maps locale IDs to locale-specific feeds.
A link to the localized JSON feed file for the specified locale.
For example, you can supply the following locale JSON to support a feed that’s localized to contain English and French versions of a subscription’s content:
Manually Adding a Subscription
If you want to distribute your playground in a classroom or workshop environment, you can instruct learners to enter the URL of your feed manually. In Swift Playgrounds, press the "Add Subscription" button and enter the URL for your feed. Manually-entered URLs must not include the Swift Playgrounds subscriptions universal link prefix. Instead, use the raw URL from your web host for the feed.