harmony 鸿蒙@ohos.customization.customConfig (定制配置)

  • 2025-06-12
  • 浏览 (4)

@ohos.customization.customConfig (定制配置)

本模块接口为应用提供定制配置的获取能力,如渠道号等。

说明:

本模块首批接口从API version 12开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

导入模块

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

customConfig.getChannelId

getChannelId(): string

根据应用的BundleName获取渠道号。

原子化服务API: 从API version 13开始,该接口支持在原子化服务中使用。

系统能力:SystemCapability.Customization.CustomConfig

返回值:

类型 说明
string 渠道号

示例:

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

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Basic Services Kit(基础服务)

harmony 鸿蒙DeviceInfo

harmony 鸿蒙OH_Print

harmony 鸿蒙Print_Margin

harmony 鸿蒙Print_PageSize

harmony 鸿蒙Print_PrintAttributes

harmony 鸿蒙Print_PrintDocCallback

harmony 鸿蒙Print_Range

harmony 鸿蒙TimeService

harmony 鸿蒙ohscan.h

0  赞