端点
上架准备指南
一个应用要上架 Google Play 和 App Store 还缺什么,以及按顺序排列的步骤。
GET
https://www.setherion.com/api/v1/projects/{id}/store套餐: 所有套餐
编辑器中的“Publish to app stores”窗口,用数据的形式表达:哪些已经准备好上架,以及使用 way 时,按顺序排列的 Android 和 iPhone 步骤。它用与该窗口相同的辅助函数读取应用已保存的代码,所以两者绝不会不一致。
它免费,不消耗积分。有查看权限就够了。关于窗口和完整的操作流程,请参阅发布到应用商店。
请求
不带 way,用于先比较两种方式:
bash
curl https://www.setherion.com/api/v1/projects/7c1e4a52-9b0d-4f3e-8a61-2d5f0c9e7b14/store \
-H "Authorization: Bearer $SETHERION_API_KEY"带 way,用于获取步骤:
bash
curl "https://www.setherion.com/api/v1/projects/7c1e4a52-9b0d-4f3e-8a61-2d5f0c9e7b14/store?way=easy" \
-H "Authorization: Bearer $SETHERION_API_KEY"| 参数 | 含义 |
|---|---|
way | 可选。easy 或 native。easy 用 PWA Builder 把已发布的网站打包成商店安装包,不需要代码。native 是把整个应用做成手机项目,由所有者在电脑上构建,投放广告和应用内购买需要它。其他任何值都会返回 400。 |
应用必须有代码。如果它已发布,这次调用还会向线上应用请求它的商店图标(/icon-512.png),最多等待 5 秒。
不带 way 的响应
json
{
"ok": true,
"app": { "name": "Coffee shop", "url": "https://coffee-shop.setherion.app" },
"ready": [
{
"item": "Published on the web",
"state": "ok",
"note": "https://coffee-shop.setherion.app"
},
{
"item": "Store icon",
"state": "ok",
"note": "PNG in every size the stores ask for, made when the app is published."
},
{
"item": "Privacy policy page",
"state": "missing",
"note": "Both stores ask for a link to one, and none was found in this app.",
"fix": "Add a Privacy Policy page at /privacy, linked from the footer and from the sign-up screen. Say what the app keeps (the account email and what people enter), why, for how long, that nothing is sold, and how to ask for an account and its data to be deleted. Leave the owner's contact email as a placeholder to fill in."
}
],
"ways": {
"easy": "Easy, no code: PWA Builder wraps the published website into store packages. About 2 steps in Setherion, the rest in the stores. Android is done from any computer; iPhone needs a Mac with Xcode.",
"native": "Native, for developers: the whole app as a phone project (Capacitor). Needed for ads and in-app purchases. Built on the owner's computer (Android Studio; a Mac with Xcode for iPhone), or in the cloud by GitHub when pushed to GitHub: no Android Studio and no Mac."
},
"onlyInSetherion": "In Setherion: open the app, Publish, then \"Publish to app stores\". Only there: dropping PWA Builder's ZIP, adding Google Play's key, downloading the phone project or pushing it to GitHub, the store screenshots (every size both stores ask for, free), and the store guidelines check. The window ticks the steps it can see, and keeps the owner's own ticks."
}| 字段 | 类型 | 含义 |
|---|---|---|
app | object | 应用的 name,以及它的 url,未发布时为 null。 |
ready | list | 哪些已准备好,哪些还缺。见下文。 |
ways | object | 每种方式(easy 和 native)各一句话。 |
onlyInSetherion | string | 只有 Setherion 窗口才能做的事,让程序知道它能触及的范围到哪里为止。 |
ready 列表
每个条目都有 item、state 和 note,有时还有 fix。
| 字段 | 含义 |
|---|---|
item | 检查的内容。 |
state | ok、missing,或者在这一刻无法检查时为 unknown。 |
note | 说明原因的一句话。 |
fix | 只出现在编辑器可以补上的 missing 条目上。这是在所有者同意之后,作为 prompt 发送给修改应用的文字,因为修改会消耗积分。 |
可能出现的条目
- Published on the web。 应用有地址时为
ok。没有地址时为missing:Easy 方式打包的是已发布的地址,所以请先发布。Native 方式不需要它。 - Store icon。 只有在应用发布之后才会列出。线上应用提供 PNG 图标时为
ok,没有提供时为missing(请再发布一次;使用自己域名的应用目前只有 SVG 图标),无法检查线上应用时为unknown。 - Delete account button。 只有在用户可以注册该应用时才会列出。没有它,Apple 会拒绝这样的应用。
missing带有fix。 - Privacy policy page。 两家商店都要求提供它的链接。
missing带有fix。
带 way 的响应
字段相同,外加你所要求方式的步骤:
json
{
"ok": true,
"app": { "name": "Coffee shop", "url": "https://coffee-shop.setherion.app" },
"ready": [ "... as above ..." ],
"ways": { "easy": "...", "native": "..." },
"way": "easy",
"android": [
{
"step": 1,
"title": "Make the Android package",
"meta": "PWA Builder, about 2 minutes",
"detail": "Open PWA Builder with the app's address filled in. Choose Package for stores, then Android, and download the ZIP.",
"link": "https://www.pwabuilder.com/reportcard?site=https%3A%2F%2Fcoffee-shop.setherion.app"
},
{
"step": 2,
"title": "Link the app to your site",
"meta": "So it opens without a browser's address bar",
"detail": "In Setherion: open the app, Publish, then \"Publish to app stores\", Easy, Android, this step: drop the ZIP from PWA Builder there. ...",
"done": false
}
],
"iphone": [ "... five steps, numbered the same way ..." ],
"iphoneNotes": [
"A Mac is needed. The Easy way builds the iPhone app on a Mac with Xcode. The Native way can build it on GitHub's Mac computers instead. Make sure you have one of the two before you pay Apple's $99 a year.",
"To Apple this looks like a website. Nobody signs in, nothing is saved, and Apple turns down apps that are only a website (guideline 4.2). Sign-in, saved data and features people come back to make it an app. Run the store guidelines check on the first page before you send it."
],
"onlyInSetherion": "..."
}(这里做了缩短:真实的响应包含每一个步骤的完整内容。)
| 字段 | 类型 | 含义 |
|---|---|---|
way | string | 所要求的方式,easy 或 native。 |
android | list | 按顺序排列的 Android 步骤。 |
iphone | list | 按顺序排列的 iPhone 步骤。 |
iphoneNotes | list of strings | Apple 可能因什么拒绝这个应用,每条一句话,标题与窗口中的标题一致。 |
每个步骤包含:
| 字段 | 类型 | 含义 |
|---|---|---|
step | number | 它在列表中的位置,从 1 开始。 |
title | string | 步骤的名称,也就是窗口里显示的那个。 |
meta | string | 一行简短的说明:需要多长时间、需要什么,或者要花多少钱。 |
detail | string | 该做什么。可能包含多行,例如要运行的命令。 |
link | string | 在哪里操作,有地方可去时才有。否则省略。 |
done | boolean | 只出现在 Setherion 能自己看出结果的步骤上,即 Android 的 Easy 方式:链接到你的网站,以及 Google Play 的密钥。无法判断时省略。 |
每份列表的步骤
Easy,Android: 制作 Android 安装包,把应用链接到你的网站,开通 Google Play 开发者账户,上传并测试,添加 Google Play 的密钥,填写商店页面并发布。
Easy,iPhone: 开通 Apple 开发者账户,制作 iPhone 安装包,构建并上传,在你的 iPhone 上试用,填写商店页面并提交审核。
Native,Android: 下载项目,构建,签名,上传并测试,发布。
Native,iPhone: 下载项目,构建,签名并上传,在你的 iPhone 上试用,填写商店页面并提交审核。
在 Native 方式中,当应用展示广告或销售商品时,detail 里的命令会包含额外的设置步骤,以及用于商店表单的广告和应用内购买说明。
错误
| 状态码 | 出现时机 |
|---|---|
400 | way 不是 easy 或 native。 |
401 | 密钥缺失、错误或已被撤销。 |
404 | 没有这个应用,或者你的密钥无法打开它。 |
409 | 应用还没有代码。请先在 Setherion 中构建它。 |
确切的提示语
| 状态码 | error |
|---|---|
400 | way is "easy" or "native". |
404 | No such app on this account. |
409 | This app has no code yet. Build it in Setherion first. |
这个页面对你有帮助吗?
