Electron 2 新功能:应用内购买
全新的 Electron 2.0 发行版本充满了新功能和修复。这个新主版本的亮点之一是为苹果的 Mac 应用商店提供的新 inAppPurchase API。
🌐 The new Electron 2.0 release line is packed with new features and fixes. One of the highlights from this new major version is a new
inAppPurchase API
for Apple's Mac App Store.
应用内购买允许用户直接在应用内购买内容或订阅。这为开发者提供了一种轻松采用免费增值商业模式的方式,在这种模式下,用户免费下载应用,但可选择购买应用内提供的高级功能、额外内容或订阅服务。
🌐 In-app purchases enable content or subscriptions to be purchased directly from within apps. This gives developers an easy way to embrace the freemium business model, wherein users pay nothing to download an app and are offered optional in-app purchases for premium features, additional content, or subscriptions.
新的 API 由社区贡献者 Adrien Fery 添加到 Electron 中,以便在讲座和会议的注意应用 Amanote 中启用应用内购买。Amanote 可以免费下载,并允许在 PDF 中添加清晰且结构化的注意,并提供数学公式、绘图、音频录制等功能。
🌐 The new API was added to Electron by community contributor Adrien Fery to enable in-app purchases in Amanote, a note-taking Electron app for lectures and conferences. Amanote is free to download and allows clear and structured notes to be added to PDFs, with features like mathematical formulae, drawings, audio recording, and more.
自从在 Amanote 的 Mac 版本中添加了应用内购买支持后,Adrien 注意到销量增加了 40%!
🌐 Since adding in-app purchase support to the Mac version of Amanote, Adrien has noted a 40% increase in sales!
入门
🌐 Getting Started
新的 inAppPurchase API 已经在最新的 Electron 测试版中发布:
🌐 The new inAppPurchase API has already landed in the latest Electron beta:
npm i -D electron@beta
API 的文档可以在 GitHub 上找到,Adrien 也非常乐意写了一篇关于如何使用 API 的教程。要开始在你的应用中添加应用内购买,请查看教程。
🌐 The docs for the API can be found on GitHub, and Adrien has been kind enough to write a tutorial on how to use the API. To get started adding in-app purchases to your app, see the tutorial.
更多 API 改进 正在进行中,并将很快在即将发布的 Electron 测试版中推出。
🌐 More improvements to the API are in the works, and will soon be landing in an upcoming Electron beta release.
Windows 可能是下一个
🌐 Windows Could Be Next
接下来,Adrien 希望通过在 Electron 中增加对 Microsoft Store 应用内购买的支持,为 Amanote 开辟新的收入渠道。敬请关注相关进展!
🌐 Up next, Adrien is hoping to open a new revenue channel for Amanote by adding support for Microsoft Store in-app purchases in Electron. Stay tuned for developments on that!