{"id":16541403,"url":"https://github.com/aerni/statamic-apple-news","last_synced_at":"2025-03-04T04:41:34.046Z","repository":{"id":56941492,"uuid":"369530369","full_name":"aerni/statamic-apple-news","owner":"aerni","description":"A Statamic addon to publish your collection entries on Apple News","archived":false,"fork":false,"pushed_at":"2021-07-28T12:59:20.000Z","size":495,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T08:52:13.214Z","etag":null,"topics":["apple-news","statamic","statamic-addon"],"latest_commit_sha":null,"homepage":"https://statamic.com/addons/aerni/apple-news","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aerni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-21T12:36:20.000Z","updated_at":"2023-05-18T16:23:16.000Z","dependencies_parsed_at":"2022-08-21T07:50:25.771Z","dependency_job_id":null,"html_url":"https://github.com/aerni/statamic-apple-news","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-apple-news","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-apple-news/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-apple-news/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-apple-news/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerni","download_url":"https://codeload.github.com/aerni/statamic-apple-news/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787488,"owners_count":20020099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-news","statamic","statamic-addon"],"created_at":"2024-10-11T18:54:55.153Z","updated_at":"2025-03-04T04:41:34.010Z","avatar_url":"https://github.com/aerni.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Statamic](https://flat.badgen.net/badge/Statamic/3.0+/FF269E) ![Packagist version](https://flat.badgen.net/packagist/v/aerni/apple-news/latest) ![Packagist Total Downloads](https://flat.badgen.net/packagist/dt/aerni/apple-news)\n\n# Apple News\nThis Statamic addon provides a powerful integration with Apple News, making it possible to publish your collection entries to iPhone, iPad, and Mac users around the world.\n\n## Prerequisites\nYou first need to [apply for News Publisher](https://www.icloud.com/newspublisher/) and create a channel before you can start publishing your content. Note that new channels have to go through an approval process before you can use them.\n\nNext, you need to get your channel's ID and API Credentials. You can get those in News Publisher `Settings -\u003e Connect CMS -\u003e API Key`.\n\n## Installation\nInstall the addon using Composer:\n\n```bash\ncomposer require aerni/apple-news\n```\n\nPublish the config of the package:\n\n```bash\nphp please vendor:publish --tag=apple-news-config\n```\n\nThe following config will be published to `config/apple-news.php`:\n\n```php\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Apple News API\n    |--------------------------------------------------------------------------\n    |\n    | The Apple News API credentials of your channel.\n    |\n    */\n\n    'id' =\u003e env('APPLE_NEWS_CHANNEL_ID'),\n    'key' =\u003e env('APPLE_NEWS_KEY'),\n    'secret' =\u003e env('APPLE_NEWS_SECRET'),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Site\n    |--------------------------------------------------------------------------\n    |\n    | The handle of the site you want to use to publish on Apple News.\n    |\n    */\n\n    'site' =\u003e 'default',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Collections\n    |--------------------------------------------------------------------------\n    |\n    | The handles of the collections whose entries you want to publish.\n    |\n    */\n\n    'collections' =\u003e [\n        // 'articles',\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Templates\n    |--------------------------------------------------------------------------\n    |\n    | The templates for your Apple News articles.\n    |\n    */\n\n    'templates' =\u003e [\n        // \\App\\AppleNews\\DefaultTemplate::class,\n    ],\n\n];\n```\n\n## Configuration\n\n### Apple News API\nAdd your Apple News API credentials to your `.env` file:\n\n```env\nAPPLE_NEWS_CHANNEL_ID=************************************\nAPPLE_NEWS_KEY=************************************\nAPPLE_NEWS_SECRET=********************************************\n```\n\n### Site\nAdd the handle of the site you want to use to publish on Apple News:\n\n```php\n'site' =\u003e 'default'\n```\n\n### Collections\nAdd the handles of the collections whose entries you want to publish on Apple News:\n\n```php\n'collections' =\u003e [\n    'articles',\n    'interviews'\n]\n```\n\n### Templates\nAdd your article template classes:\n\n```php\n'templates' =\u003e [\n    \\App\\AppleNews\\DefaultTemplate::class,\n    \\App\\AppleNews\\InterviewTemplate::class,\n]\n```\n\n## Article Templates\n\n### Creating a template\nCreate your first article template:\n\n```bash\nphp please apple-news:template {name}\n```\n\nThis will publish a new template to `app/AppleNews/{name}.php`.\n\n### Customizing a template\nEach template consists of a set of methods to configure your articles. They are powered by the excellent [AppleNewsAPI](https://github.com/chapter-three/AppleNewsAPI) library that lets you define your article's layout, components, styles, etc. Make sure to [take a look at the source](https://github.com/chapter-three/AppleNewsAPI/tree/master/src/Document) to get an idea of the classes and methods available to you.\n\n## Previewing an article\n\n[News Preview](https://developer.apple.com/news-preview/) is an app provided by Apple that lets you preview your articles in the News app. This is super useful when building out your templates.\n\nUse the following command and provide the `id` of the Statamic entry you want to use for preview:\n\n```bash\nphp please apple-news:preview {entryId}\n```\n\nThis creates an `article.json` file of the entry in `storage/statamic/addons/apple-news/preview/`.\n\nOpen the `News Preview` app, select the `article.json` file, and choose the device you want to use to preview your article.\n\n## Publishing Workflow\n\n### Publishing\nOpen the entry in the Statamic Control Panel that you want to publish on Apple News. Navigate to the `Apple News` tab and customize the options to your liking. Once you're ready to publish, flick the `Published` toggle and save the entry. The article is now being processed by Apple News. Refresh the page to see the current `Publish State`.\n\n### Updating\nThe article will be updated every time you save the Statamic entry.\n\n\u003e **Note:** The article is updated every time the `Statamic\\Events\\EntrySaving` event is dispatched.\n\n### Unpublishing / Deleting\nUnflick the `Published` toggle to delete the article from Apple News. Deleting the Statamic entry will do the same.\n\n\u003e **Note:** Apple News doesn't support unpublishing an article. Articles can only be deleted. Alternatively you can use the `Hidden` toggle to hide the article from Apple News feeds.\n\n## License\nApple News is **commercial software** but has an open-source codebase. If you want to use it in production, you'll need to [buy a license from the Statamic Marketplace](https://statamic.com/addons/aerni/apple-news).\n\u003eApple News is **NOT** free software.\n\n## Credits\nDeveloped by [Michael Aerni](https://www.michaelaerni.ch)\n\n## Special Thanks\nMany thanks to [Duo Security](https://duo.com/) and [Cisco](https://www.cisco.com/) for sponsoring this addon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerni%2Fstatamic-apple-news","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerni%2Fstatamic-apple-news","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerni%2Fstatamic-apple-news/lists"}