UNPKG

mx-jpush-expo

Version:

Expo 集成极光推送(JPush)一体化解决方案,支持 iOS/Android 厂商通道

43 lines 1.65 kB
"use strict"; /** * Android gradle.properties 配置 * 处理 Gradle 8.0 版本兼容性问题 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.applyAndroidGradleProperties = applyAndroidGradleProperties; exports.withAndroidGradleProperties = withAndroidGradleProperties; const config_plugins_1 = require("expo/config-plugins"); function applyAndroidGradleProperties(properties, vendorChannels) { if (!vendorChannels?.huawei?.enabled) { return properties; } console.log('\n[MX_JPush_Expo] 配置 gradle.properties 华为 AGC 兼容性(Gradle 8.0)...'); const existingProp = properties.find((prop) => prop.type === 'property' && prop.key === 'apmsInstrumentationEnabled'); if (existingProp) { return properties; } return [ ...properties, { type: 'property', key: 'apmsInstrumentationEnabled', value: 'false', }, ]; } /** * 配置 Android gradle.properties * * 说明: * - 如果使用 Gradle 8.0 版本,且集成华为 AGC 插件版本低于 1.9.1.300, * 需要添加 apmsInstrumentationEnabled=false 来禁用 APMS 插件 * - 当前使用的 AGC 版本为 1.9.1.301,理论上不需要此配置 * - 但为了兼容性和避免潜在问题,仍然添加此配置 */ function withAndroidGradleProperties(config, props) { return (0, config_plugins_1.withGradleProperties)(config, (nextConfig) => { nextConfig.modResults = applyAndroidGradleProperties(nextConfig.modResults, props.vendorChannels); return nextConfig; }); } //# sourceMappingURL=gradleProperties.js.map