aerni/apple-news
Composer 安装命令:
composer require aerni/apple-news
包简介
A Statamic addon to publish your collection entries on Apple News.
关键字:
README 文档
README
Apple News
This 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.
Prerequisites
You first need to apply for News Publisher 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.
Next, you need to get your channel's ID and API Credentials. You can get those in News Publisher Settings -> Connect CMS -> API Key.
Installation
Install the addon using Composer:
composer require aerni/apple-news
Publish the config of the package:
php please vendor:publish --tag=apple-news-config
The following config will be published to config/apple-news.php:
return [ /* |-------------------------------------------------------------------------- | Apple News API |-------------------------------------------------------------------------- | | The Apple News API credentials of your channel. | */ 'id' => env('APPLE_NEWS_CHANNEL_ID'), 'key' => env('APPLE_NEWS_KEY'), 'secret' => env('APPLE_NEWS_SECRET'), /* |-------------------------------------------------------------------------- | Site |-------------------------------------------------------------------------- | | The handle of the site you want to use to publish on Apple News. | */ 'site' => 'default', /* |-------------------------------------------------------------------------- | Collections |-------------------------------------------------------------------------- | | The handles of the collections whose entries you want to publish. | */ 'collections' => [ // 'articles', ], /* |-------------------------------------------------------------------------- | Templates |-------------------------------------------------------------------------- | | The templates for your Apple News articles. | */ 'templates' => [ // \App\AppleNews\DefaultTemplate::class, ], ];
Configuration
Apple News API
Add your Apple News API credentials to your .env file:
APPLE_NEWS_CHANNEL_ID=************************************ APPLE_NEWS_KEY=************************************ APPLE_NEWS_SECRET=********************************************
Site
Add the handle of the site you want to use to publish on Apple News:
'site' => 'default'
Collections
Add the handles of the collections whose entries you want to publish on Apple News:
'collections' => [ 'articles', 'interviews' ]
Templates
Add your article template classes:
'templates' => [ \App\AppleNews\DefaultTemplate::class, \App\AppleNews\InterviewTemplate::class, ]
Article Templates
Creating a template
Create your first article template:
php please apple-news:template {name}
This will publish a new template to app/AppleNews/{name}.php.
Customizing a template
Each template consists of a set of methods to configure your articles. They are powered by the excellent AppleNewsAPI library that lets you define your article's layout, components, styles, etc. Make sure to take a look at the source to get an idea of the classes and methods available to you.
Previewing an article
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.
Use the following command and provide the id of the Statamic entry you want to use for preview:
php please apple-news:preview {entryId}
This creates an article.json file of the entry in storage/statamic/addons/apple-news/preview/.
Open the News Preview app, select the article.json file, and choose the device you want to use to preview your article.
Publishing Workflow
Publishing
Open 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.
Updating
The article will be updated every time you save the Statamic entry.
Note: The article is updated every time the
Statamic\Events\EntrySavingevent is dispatched.
Unpublishing / Deleting
Unflick the Published toggle to delete the article from Apple News. Deleting the Statamic entry will do the same.
Note: Apple News doesn't support unpublishing an article. Articles can only be deleted. Alternatively you can use the
Hiddentoggle to hide the article from Apple News feeds.
License
Apple 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.
Apple News is NOT free software.
Credits
Developed by Michael Aerni
Special Thanks
Many thanks to Duo Security and Cisco for sponsoring this addon.
aerni/apple-news 适用场景与选型建议
aerni/apple-news 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 507 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「apple」 「news」 「statamic」 「apple news」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aerni/apple-news 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aerni/apple-news 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aerni/apple-news 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple library to decode and parse Apple Sign In client tokens.
Apple Push Notification & Feedback Provider
Statamic Fine Seo addon
Extend news to use them also as event
This TYPO3 distribution provides a sample website using bootstrap and the extensions pizpalue and container_elements. The distribution tailors Swiss market featuring German as default language and additional translations to French, English and Finnish.
统计信息
- 总下载量: 507
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2021-06-01