---
title: "使用远程配置自定义流程"
description: "使用远程配置 JSON 数据自定义 Flow Builder 流程。"
---

:::important
本指南介绍 Flow Builder 的远程配置。若需了解不使用 Flow Builder 创建的经典付费墙，请参阅[使用远程配置设计付费墙](customize-paywall-with-remote-config)。
:::
远程配置允许你存储自定义 JSON 数据，SDK 在运行时读取这些数据。你可以用它来设置标题、图片、字体、颜色或功能开关等内容，无需发布新版本。
## 使用远程配置 \{#work-with-remote-config\}

要打开某个流程的远程配置，请点击流程编辑器中屏幕预览上方的 Remote Config 图标。

在 **JSON** 视图中，你可以输入任意 JSON 格式的数据。编辑器会为你添加的每个语言区域显示一列：

您可以稍后通过 SDK 中 `AdaptyFlow` 的 `remoteConfigs` 数组访问这些数据。Adapty 为每个语言区域存储一个 `AdaptyRemoteConfig` 条目；选取与用户语言区域匹配的条目，读取解析后的 `dictionary` 或原始 `jsonString`，即可在运行时调整您的流程。以下是一些远程配置的使用示例。
<Tabs>
  <TabItem value="Titles" label="标题" default>
```json showLineNumbers
{
    "screen_title": "Today only: Subscribe, and get 7 days for free!"
}

# Test titles or other texts
```
</TabItem>
<TabItem value="Images" label="图片">
```json showLineNumbers
{
    "background_image": "https://adapty.io/media/paywalls/bg1.webp"
}

# Test images on your flow
```
</TabItem>
<TabItem value="Fonts" label="字体">
```json showLineNumbers
{
    "font_family": "San Francisco",
    "font_size": 16
}

# Test fonts
```
</TabItem>
<TabItem value="Color" label="颜色">
```json showLineNumbers
{
    "subscribe_button_color": "purple"
}

# Test colors of buttons, texts etc.
```
</TabItem>
<TabItem value="HTML" label="HTML">
```json showLineNumbers
{
    "photo_gallery": "https://adapty.io/media/paywalls/link-to-html-snippet.html"
}

# Any HTML code that can be displayed in the flow
```
</TabItem>
<TabItem value="Soft/Hard Paywall" label="软性/硬性付费墙">
```json showLineNumbers
{
    "hard_paywall": true
}

# By setting it to true, you disallow skipping the paywall without subscribing
# You have to handle this logic in your app
```
</TabItem>
<TabItem value="Translations" label="翻译">
```json showLineNumbers
{
    "title": {
        "en": "Try for free!",
        "es": "¡Prueba gratis!",
        "ru": "Попробуй бесплатно!"
    }
}
```
</TabItem>
</Tabs>
你可以随意组合这些模式，也可以自定义键名，用于测试不同的文案、布局或行为。

接下来，[创建一个版位](create-placement)并将流程添加到其中，然后[在你的 iOS 应用中渲染该流程](present-remote-config-paywalls)。
## 添加语言区域 \{#add-a-locale\}

要为流程添加本地化，请在编辑器上方点击 **Add locale** 并选择语言区域。

Adapty 会在编辑器中为该语言区域新增一列。每列可独立编辑——运行时，SDK 会返回 `locale` 与用户选择相匹配的 `AdaptyRemoteConfig` 条目。

## 导入和导出 JSON \{#import-and-export-json\}

使用编辑器上方的 **Import/Export** 菜单，可以一次性备份、分享或批量编辑所有语言区域的远程配置。

- **Export JSON**：下载一个包含所有语言区域的 JSON 文件。
- **Import JSON**：上传相同格式的 JSON 文件。上传后将替换当前的远程配置。

该文件以语言区域代码作为顶层键，对应的值为该语言区域的数据内容：
```json showLineNumbers
{
  "en": {
    "title": "Get Premium",
    "cta": "Continue",
    "trial_days": 7,
    "features": ["sync", "export", "ai"]
  },
  "fr": {
    "title": "Passez à Premium",
    "cta": "Continuer",
    "trial_days": 7,
    "features": ["synchronisation", "exportation", "IA"]
  }
}
```

每个语言区块遵循与直接输入语言列相同的 JSON 结构。