asc-promoted-purchases
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseasc Promoted Purchases
asc 推广内购
Manage App Store product page Promoted In-App Purchases — the featured IAPs / auto-renewable subscriptions surfaced under an app's product page on the App Store. Each slot promotes either an IAP or a subscription (mutually exclusive) and goes through App Review separately from the underlying product.
管理App Store产品页的推广内购项目(Promoted In-App Purchases)——即App Store应用产品页下方展示的精选内购项目(IAP)/自动续订订阅。每个插槽只能推广一个IAP或一项订阅(二者互斥),且需独立于基础产品通过App审核。
List
列出插槽
bash
asc promoted-purchases list --app-id <APP_ID> [--limit N] [--pretty]bash
asc promoted-purchases list --app-id <APP_ID> [--limit N] [--pretty]Create
创建推广插槽
Exactly one of or is required (the command validates and rejects both/neither):
--iap-id--subscription-idbash
undefined必须指定或其中一个(命令会进行校验,同时指定或都不指定都会被拒绝):
--iap-id--subscription-idbash
undefinedPromote an in-app purchase
推广内购项目
asc promoted-purchases create --app-id <APP_ID> --iap-id <IAP_ID> --visible --enabled
asc promoted-purchases create --app-id <APP_ID> --iap-id <IAP_ID> --visible --enabled
Promote an auto-renewable subscription
推广自动续订订阅
asc promoted-purchases create --app-id <APP_ID> --subscription-id <SUB_ID> --hidden --disabled
`--visible` / `--hidden` flip `isVisibleForAllUsers`. `--enabled` / `--disabled` flip `isEnabled`. Defaults: `isVisibleForAllUsers=true`, `isEnabled` left unchanged when both flags omitted.asc promoted-purchases create --app-id <APP_ID> --subscription-id <SUB_ID> --hidden --disabled
`--visible` / `--hidden`用于切换`isVisibleForAllUsers`状态。`--enabled` / `--disabled`用于切换`isEnabled`状态。默认值:`isVisibleForAllUsers=true`,若同时省略两组标志,`isEnabled`状态保持不变。Update
更新推广插槽
bash
asc promoted-purchases update --promoted-id <PROMOTED_ID> [--visible | --hidden] [--enabled | --disabled]Omitting a flag pair leaves that field unchanged.
bash
asc promoted-purchases update --promoted-id <PROMOTED_ID> [--visible | --hidden] [--enabled | --disabled]省略某组标志时,对应字段保持不变。
Delete
删除推广插槽
bash
asc promoted-purchases delete --promoted-id <PROMOTED_ID>bash
asc promoted-purchases delete --promoted-id <PROMOTED_ID>State semantics
状态语义
PromotedPurchaseState| Boolean | True when state is |
|---|---|
| |
| |
PromotedPurchaseState| 布尔值 | 为True时的状态 |
|---|---|
| |
| |
State-aware affordances
感知状态的操作选项
JSON responses suppress mutations that ASC would reject as 409 conflicts:
| State | | |
|---|---|---|
| shown | shown |
| suppressed | suppressed |
json
{
"affordances": {
"listSiblings": "asc promoted-purchases list --app-id <APP_ID>",
"update": "asc promoted-purchases update --promoted-id <ID>", // omitted while in review
"delete": "asc promoted-purchases delete --promoted-id <ID>" // omitted while in review
}
}JSON响应会隐藏ASC会以409冲突为由拒绝的操作:
| 状态 | | |
|---|---|---|
| 显示 | 显示 |
| 隐藏 | 隐藏 |
json
{
"affordances": {
"listSiblings": "asc promoted-purchases list --app-id <APP_ID>",
"update": "asc promoted-purchases update --promoted-id <ID>", // 审核中时隐藏
"delete": "asc promoted-purchases delete --promoted-id <ID>" // 审核中时隐藏
}
}Resolve App ID
解析App ID
See project-context.md — check before asking the user or running .
.asc/project.jsonasc apps list详见project-context.md——在询问用户或运行前,请先检查文件。
asc apps list.asc/project.jsonTypical Workflow
典型工作流
bash
APP_ID=$(cat .asc/project.json 2>/dev/null | jq -r '.appId // empty')bash
APP_ID=$(cat .asc/project.json 2>/dev/null | jq -r '.appId // empty')Promote an IAP, visible to all users, slot enabled.
推广一个IAP,对所有用户可见,插槽启用
PROMO_ID=$(asc promoted-purchases create --app-id "$APP_ID"
--iap-id "iap-1" --visible --enabled
| jq -r '.data[0].id')
--iap-id "iap-1" --visible --enabled
| jq -r '.data[0].id')
PROMO_ID=$(asc promoted-purchases create --app-id "$APP_ID"
--iap-id "iap-1" --visible --enabled
| jq -r '.data[0].id')
--iap-id "iap-1" --visible --enabled
| jq -r '.data[0].id')
Later: hide it temporarily without deleting
后续操作:临时隐藏而非删除
asc promoted-purchases update --promoted-id "$PROMO_ID" --hidden
asc promoted-purchases update --promoted-id "$PROMO_ID" --hidden
Or just remove the slot
或者直接移除插槽
asc promoted-purchases delete --promoted-id "$PROMO_ID"
undefinedasc promoted-purchases delete --promoted-id "$PROMO_ID"
undefinedReference
参考资料
For full domain-model and REST detail see docs/features/promoted-purchases.md.
如需完整领域模型和REST细节,请查看docs/features/promoted-purchases.md。