- 实现了华为 HMS 推送服务集成 - 实现了小米推送服务集成 - 实现了 OPPO 推送服务集成 - 实现了 vivo 推送服务集成 - 实现了荣耀推送服务集成 - 实现了 FCM 推送服务集成 - 添加了统一的厂商推送接口和检测机制 - 添加了推送配置 API 和存储管理 - 添加了推送令牌管理和设备注册功能 - 添加了模拟器环境的推送测试用例
41 行
916 B
Swift
41 行
916 B
Swift
import Foundation
|
|
|
|
public struct SDKConfig: Sendable {
|
|
public let appKey: String
|
|
public let debug: Bool
|
|
public let autoRegisterPush: Bool
|
|
|
|
public init(
|
|
appKey: String,
|
|
debug: Bool = false,
|
|
autoRegisterPush: Bool = true
|
|
) {
|
|
self.appKey = appKey
|
|
self.debug = debug
|
|
self.autoRegisterPush = autoRegisterPush
|
|
}
|
|
}
|
|
|
|
public extension SDKConfig {
|
|
static func development(
|
|
appKey: String,
|
|
debug: Bool = false,
|
|
autoRegisterPush: Bool = true
|
|
) -> SDKConfig {
|
|
SDKConfig(
|
|
appKey: appKey,
|
|
debug: debug,
|
|
autoRegisterPush: autoRegisterPush
|
|
)
|
|
}
|
|
}
|
|
|
|
extension SDKConfig {
|
|
var appId: String { appKey }
|
|
}
|
|
|
|
enum SDKEndpoints {
|
|
static let apiBaseURL = URL(string: "https://dev.xuqinmin.com")!
|
|
static let imWebSocketURL = URL(string: "wss://dev.xuqinmin.com/ws/im")!
|
|
}
|