添加multishare配置,用来开启关闭3分享
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
// BundleConfig.swift
|
||||
// ylgamehall
|
||||
//
|
||||
// 渠道注入配置:从 Bundle 内的 ChannelConfig.plist 读 10 个 string 值。
|
||||
// 渠道注入配置:从 Bundle 内的 ChannelConfig.plist 读 11 个 string 值。
|
||||
// 设计模式与契约见 docs/H5-Native-Implementation-Design.md §7 / ADR-007。
|
||||
//
|
||||
// 注:原有 qiniudomain 字段已于 2026-06-27 移除,七牛 CDN 域名改由
|
||||
// RemoteConfig 顶层 audio_domain 单一权威源动态下发。
|
||||
// 注:
|
||||
// - 原有 qiniudomain 字段已于 2026-06-27 移除,七牛 CDN 域名改由
|
||||
// RemoteConfig 顶层 audio_domain 单一权威源动态下发。
|
||||
// - 新增 multishare 字段:控制子游戏 sharefriend=1 好友分享的形态
|
||||
// ("1" = SharePanel 三选一 / "0" = 仅微信直发)。
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// 渠道注入配置(10 项),由 `BundleConfig.shared` 在 App 启动时一次性加载,运行期不变。
|
||||
/// 渠道注入配置(11 项),由 `BundleConfig.shared` 在 App 启动时一次性加载,运行期不变。
|
||||
///
|
||||
/// 多渠道分发:构建后用 `plutil` 修改 `.app/ChannelConfig.plist` + 重签,
|
||||
/// 不需要重新 Xcode build。详见 ADR-007。
|
||||
@@ -30,6 +33,17 @@ nonisolated public final class BundleConfig: Sendable {
|
||||
public let appVersion: String
|
||||
public let other: String
|
||||
public let appleConfig: String
|
||||
/// 子游戏内 sharefriend=1 好友分享的形态开关(渠道级):
|
||||
/// "1" → SharePanel 三选一(微信 / QQ / 抖音,当前默认行为)
|
||||
/// "0" → 关闭三分享,直接走微信分享(不弹面板)
|
||||
/// 缺失或其他值视为 "1"(默认开启,兼容旧行为)。
|
||||
public let multiShare: String
|
||||
|
||||
/// 是否启用 SharePanel 三选一。等价 `multiShare != "0"`;
|
||||
/// 空字符串 / 缺失字段视为启用(默认行为)。
|
||||
public var isMultiShareEnabled: Bool {
|
||||
multiShare != "0"
|
||||
}
|
||||
|
||||
/// 单测可注入任意 bundle 验证不同 plist fixture。
|
||||
public init(bundle: Bundle = .main) {
|
||||
@@ -44,6 +58,7 @@ nonisolated public final class BundleConfig: Sendable {
|
||||
appVersion = dict["appversion"] ?? ""
|
||||
other = dict["other"] ?? ""
|
||||
appleConfig = dict["appleconfig"] ?? ""
|
||||
multiShare = dict["multishare"] ?? ""
|
||||
}
|
||||
|
||||
private static func loadPlist(bundle: Bundle) -> [String: String] {
|
||||
|
||||
Reference in New Issue
Block a user