integrateCameraGallery
配置 iOS 工程相机与相册相关权限、Capabilities 与 Info.plist 项。
前置依赖
注入 fs / path / plist 修改能力(IntegrateCameraGalleryIOSDeps,见源码)。
函数签名
typescript
function integrateCameraGalleryIOS(
projectPath: string,
options: IntegrateCameraGalleryIOSOptions,
deps: IntegrateCameraGalleryIOSDeps,
): Promise<IntegrateCameraGalleryIOSResult>参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
projectPath | string | 是 | iOS 工程根 |
options | object | 是 | 权限文案、是否启用相册/相机等开关 |
deps | IntegrateCameraGalleryIOSDeps | 是 | 环境依赖 |
返回值
| 类型 | 说明 |
|---|---|
{ success, error?, logs[] } | 集成结果 |
工作原理
- 写入
NSCameraUsageDescription、NSPhotoLibraryUsageDescription等键。 - 按需修改 Xcode 工程 capabilities(见源码 pbxproj / entitlements 步骤)。
- 返回结构化 logs 便于 CI 输出。