asc-promoted-purchases

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

asc 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
--iap-id
or
--subscription-id
is required (the command validates and rejects both/neither):
bash
undefined
必须指定
--iap-id
--subscription-id
其中一个(命令会进行校验,同时指定或都不指定都会被拒绝):
bash
undefined

Promote 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
exposes semantic booleans:
BooleanTrue when state is
isLocked
WAITING_FOR_REVIEW
,
IN_REVIEW
isApproved
APPROVED
PromotedPurchaseState
定义了语义化布尔值:
布尔值为True时的状态
isLocked
WAITING_FOR_REVIEW
IN_REVIEW
isApproved
APPROVED

State-aware affordances

感知状态的操作选项

JSON responses suppress mutations that ASC would reject as 409 conflicts:
State
update
link
delete
link
approved
/
rejected
/
prepareForSubmission
/
developerActionNeeded
shownshown
waitingForReview
/
inReview
(i.e.
state.isLocked
)
suppressedsuppressed
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冲突为由拒绝的操作:
状态
update
链接
delete
链接
approved
/
rejected
/
prepareForSubmission
/
developerActionNeeded
显示显示
waitingForReview
/
inReview
(即
state.isLocked
隐藏隐藏
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
.asc/project.json
before asking the user or running
asc apps list
.
详见project-context.md——在询问用户或运行
asc apps list
前,请先检查
.asc/project.json
文件。

Typical 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')
PROMO_ID=$(asc promoted-purchases create --app-id "$APP_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"
undefined
asc promoted-purchases delete --promoted-id "$PROMO_ID"
undefined

Reference

参考资料

For full domain-model and REST detail see docs/features/promoted-purchases.md.
如需完整领域模型和REST细节,请查看docs/features/promoted-purchases.md