openharmony 鸿蒙 js-apis-customization-customConfig

2025-06-12 浏览 (1)

@ohos.customization.customConfig (Custom Configurations)

This module provides APIs for applications to obtain custom configurations, such as channel IDs.

NOTE

The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { customConfig } from '@kit.BasicServicesKit';

customConfig.getChannelId

getChannelId(): string

Obtains the channel ID based on the bundle name of an application.

Atomic service API: This API can be used in atomic services since API version 13.

System capability: SystemCapability.Customization.CustomConfig

Return value

TypeDescription
stringChannel ID

Example

  let channelId: string = customConfig.getChannelId();
  console.log('app channelId is ' + channelId);

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Basic Services Kit

harmony 鸿蒙DeviceInfo

harmony 鸿蒙InitSync

harmony 鸿蒙OH_Print

harmony 鸿蒙OsAccount

harmony 鸿蒙Pasteboard

harmony 鸿蒙Print_Margin

harmony 鸿蒙Print_PageSize

harmony 鸿蒙Print_PrintAttributes

harmony 鸿蒙Print_PrintDocCallback

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/kaYQNl