跳到主要内容

Basic Configurations

ESP RainMaker Home is a hybrid application that connects with the ESP RainMaker cloud which might be privately deployed in your AWS account. The out-of-the-box app needs to be configured to use with your privately deployed instance of ESP RainMaker.

Assumption is that you have already cloned the open source GitHub repo of ESP RainMaker Home App. Go to your cloned repo and its home directory. Edit the rainmaker.config.ts file.

Cloud Configuration

Change the baseUrl config parameter in the config section below, pointing to your cloud backend endpoint.

KeyTypeDescription
baseUrl字符串与每个 API 端点相对应。获取端点请参考获取 RainMaker API URL

3rd Party Login

Further you will have to change the authentication URL and other parameters like clientId and redirect URL as per your deployment.

Key类型描述
clientId字符串用于识别用户池中的应用。详细内容请参阅在哪里可以找到第三方集成和手机应用的 Client ID 和回调 URL
authUrl字符串第三方登录的 OAuth 网址。详细内容请参阅在哪里可以找到认证 URL
redirectUri字符串自定义 URI 方案,第三方登录完成后将用户重定向至应用。请把此值复制到 rainmaker.config.ts 文件中,具体步骤请参阅设置重定向 URI

Edit rainmaker.config.ts file in the root folder:

export const SDKConfig = {
baseUrl: "<private_rainmaker_deployment_endpoint>",
version: "v1",
authUrl: "https://3pauth.rainmaker.espressif.com",
clientId: "1h7ujqjs8140n17v0ahb4n51m2",
redirectUrl: "rainmaker://com.espressif.novahome/success",
customStorageAdapter: asyncStorageAdapter,
localDiscoveryAdapter: EspLocalDiscoveryAdapter,
localControlAdapter: ESPLocalControlAdapter,
provisionAdapter: provisionAdapter,
notificationAdapter: ESPNotificationAdapter,
oauthAdapter: espOauthAdapter,
appUtilityAdapter: ESPAppUtilityAdapter,
};

export const CDFConfig = {
autoSync: true, // Enable automatic data synchronization
};

These consist of links that open your project related documentation within the app browser.

KeyTypeDescription
WEBSITE_LINK字符串文档链接
PRIVACY_POLICY_LINK字符串隐私政策链接
TERMS_OF_USE_LINK字符串使用条款链接

Please provide valid URLs for each document type in the constants.ts file:

export const WEBSITE_LINK = "https://rainmaker.espressif.com";
export const TERMS_OF_USE_LINK =
"https://rainmaker.espressif.com/docs/terms-of-use.html";
export const PRIVACY_POLICY_LINK =
"https://rainmaker.espressif.com/docs/privacy-policy.html";

iOS Specific Configurations

Apple Developer Settings

在苹果开发者控制台创建应用 ID

  1. 打开苹果开发者网站

  2. 点击左侧菜单中的 Identifiers,点击 + 图标,添加新的标识符。

    Apple Identifiers

  3. 从列表中选择 App IDs,然后点击 Continue

    Apple Sign In

  4. 从类型中选择 App

    App type

  5. 为你的应用添加 Bundle IDDescription 字段,请保证 Bundle ID 与你在 RainMaker iOS 应用中所使用的 ID 保持一致。

    Register AppId

  6. 向下滚动页面,选择 Push NotificationsSign In with Apple 功能,并点击 Continue

    Register AppId

  7. 检查更改并确认配置。

  8. 请记录下你的 Team ID App ID Prefix 值和 Bundle ID 值,然后点击 Register 保存更改。

    Register AppId

In case of iOS apps, creating app groups allows you to create a container as a shared storage space. This is a necessary step for notification service usage.

App Group

App Group 功能支持由一个团队开发的多个应用程序共同维护共享容器(存储空间)。在这种情况下,该容器由应用程序和扩展通知服务共享。共享容器用于存储节点的详细信息,这些信息用于通知服务中的自定义通知功能。更多信息请参阅什么是 iOS 的 App Group

配置 App Group
  1. 进入苹果开发者控制台,打开标识符:https://developer.apple.com/account/resources/identifiers/list。
  2. 点击 + 图标,添加新的标识符。
  3. 从列表中选择 App Groups 并点击 Continue

ios_config_app_group

  1. 为你的 App Group 添加 DescriptionIdentifier 字段,点击 Continue

ios_config_register_app_group

  1. 检查改动并点击 Register 保存更改。

ios_config_register_app_group-1

在 Xcode 中配置 App Group
  1. 打开 Xcode 项目,在你的主应用目标中,打开 Signing & Capabilities
  2. App Groups 性能下勾选你之前配置的 App Group。

ios_config_xcode_app_group

On this page