Skip to main content

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
baseUrlStringConsistent part of each API endpoint. Follow Get Base Url steps to fetch the endpoint.

3rd Party Login

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

KeyTypeDescription
clientIdStringUniquely identifies an app in a user pool. Check steps to get the Client ID
authUrlStringOAuth URL for third party login. Check steps to get the Authentication URL.
redirectUriStringCustom URI schemes needed for redirecting user back to your app after third party login is completed. You also need to copy this value into rainmaker.config.ts file, refer here.

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_LINKStringYour company, product or service website link.
PRIVACY_POLICY_LINKStringPrivacy Policy link.
TERMS_OF_USE_LINKStringTerms 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


Creating App ID in Apple Developer Console

  1. Go to the Apple Developer portal: https://developer.apple.com/account/resources

  2. Click Identifiers from the left menu. Click the + button to register a new identifier.

    Apple Identifiers

  3. Select App IDs from the list and click Continue.

    Apple Sign In

  4. Select App from the type.

    App type

  5. Add Bundle ID and Description for your app. Keep this Bundle ID the same as the one used in your RainMaker iOS app project.

    Register AppId

  6. Scroll down the page. Select Push Notifications and Sign in with Apple as capabilities. Click Continue.

    Register AppId

  7. Review and confirm the configurations.

  8. Take note of Team ID(App ID prefix) and Bundle ID value. Click 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 groups allow multiple apps produced by a single development team to maintain shared container (storage space). In this particular case, this container is shared between the app and the notification service extension. It is used to store Node details which are required by the Notification service to customize notification messages. Find more information on app groups here.

Configuring App Group
  1. Go to Apple Developer Console and into identifiers: https://developer.apple.com/account/resources/identifiers/list.
  2. Add a new identifier by clicking on the + button.
  3. Select App Groups from the list and click Continue.

ios_config_app_group

  1. Add Description and Identifier for your app group and continue.

ios_config_register_app_group

  1. Review your changes and click Register to save it.

ios_config_register_app_group-1

Configure App Group in Xcode
  1. Open your Xcode project and go to Signing and Capabilities in the main app target.
  2. Under App Groups capabilities select the app group that you have configured earlier.

ios_config_xcode_app_group

On this page