Skip to content

integrateCameraGallery

配置 iOS 工程相机与相册相关权限、Capabilities 与 Info.plist 项。

前置依赖

注入 fs / path / plist 修改能力(IntegrateCameraGalleryIOSDeps,见源码)。

函数签名

typescript
function integrateCameraGalleryIOS(
  projectPath: string,
  options: IntegrateCameraGalleryIOSOptions,
  deps: IntegrateCameraGalleryIOSDeps,
): Promise<IntegrateCameraGalleryIOSResult>

参数

参数名类型必填说明
projectPathstringiOS 工程根
optionsobject权限文案、是否启用相册/相机等开关
depsIntegrateCameraGalleryIOSDeps环境依赖

返回值

类型说明
{ success, error?, logs[] }集成结果

工作原理

  1. 写入 NSCameraUsageDescriptionNSPhotoLibraryUsageDescription 等键。
  2. 按需修改 Xcode 工程 capabilities(见源码 pbxproj / entitlements 步骤)。
  3. 返回结构化 logs 便于 CI 输出。