Class

ConfigApi

ConfigApi()

Configuration Hooks. Instance name: configApi

The ConfigApi enables you to configure various setup options within your app.

Constructor

# new ConfigApi()

Example
externalCodeSetup.configApi.METHOD_NAME

Members

# features

Deprecated:
  • Yes

# multisiteDrawerEnabled

Deprecated:
  • Yes

# setAppSwitchEnabled

You can enable the option to switch apps when you shake your phone. If you set the option to true it will show a "Switch App" option in your screen that you can select to switch between different apps.

Example
externalCodeSetup.configApi.setAppSwitchEnabled(true);

# setCodeVerificationEnabled

You can use this hook to set the default behavior for when a user creates an account, the app navigates to the code verification screen where the user can enter the verification code.

Example
externalCodeSetup.configApi.setCodeVerificationEnabled(false);

# setGuestLoginEnabled

Toggles the guest login feature. This will override the setting found in BuddyBoss site > BuddyBoss App > Settings > General > Registration > Privacy. If set to true, it will always show "Continue without logging in" on the login screen.

Example
externalCodeSetup.configApi.setGuestLoginEnabled(true);

# setTrackPlayerEnabled

If enabled, app will initialize TrackPlayer from "react-native-track-player" package. You can get more information on react native track player https://github.com/DoubleSymmetry/react-native-track-player.

Example
externalCodeSetup.configApi.setTrackPlayerEnabled();

Methods

# setAssetPath(assetPath)

You can use this hook to modify the assetExtensionFromUrl function which is used to get the path of the downloaded file. It is also used to create the path where the downloaded file will be stored.

Parameters:
Name Type Description
assetPath AssetPathCallback
Example
import { RNFetchBlob } from "rn-fetch-blob";

...

externalCodeSetup.configApi.setAssetPath((url, localName) => {
  const {
      fs: {dirs}
  } = RNFetchBlob;
  const DIR_PATH = dirs.DocumentDir;
  if (localName) {
      return `${DIR_PATH}/${localName}`;
  }

  const arr = url.split("/");
  let ext = arr[arr.length - 1].replace(/[?&+%!@#$^()\[\]=]/g, "");
  if (url.includes("vimeo")) {
      ext = ext + ".mp4";
  }

  return `${DIR_PATH}/${ext}`;
});