- Android: correct version header 0.5.x→0.4.x, add sdk-license to module table, update artifact versions to 0.4.10 - iOS: correct min version iOS 14→16, bump version to 0.2.0, update SPM ref to from: "0.2.0" - RN: fix version 0.3.x→0.2.x, standardize npm registry URL, add @xuqm/rn-license to module table - Flutter: update git ref to v0.2.2, add xuqm_flutter_license to module tables - Add new docs: ios/license, rn/push, rn/license, flutter/push, flutter/update, flutter/license - tenant-platform: make appKey a computed ref in Push/VersionManagementView to fix service gating reactivity on route change - tenant-platform: add requestActivation API endpoint - tenant-platform: add IM service gating UI (checkServiceEnabled + activation dialog) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
95 行
1.8 KiB
Markdown
95 行
1.8 KiB
Markdown
# iOS 安装配置
|
||
|
||
**版本**:0.2.0 · **最低 iOS 版本**:iOS 16 · **语言**:Swift 5.9+
|
||
|
||
---
|
||
|
||
## Swift Package Manager(推荐)
|
||
|
||
SDK 已发布到 Gitea,在 Xcode → File → Add Package Dependencies 中输入:
|
||
|
||
```
|
||
https://xuqinmin.com/xuqinmin12/XuqmGroup-iOSSDK
|
||
```
|
||
|
||
或在 `Package.swift` 中添加:
|
||
|
||
```swift
|
||
// swift-tools-version: 5.9
|
||
import PackageDescription
|
||
|
||
let package = Package(
|
||
name: "MyApp",
|
||
platforms: [.iOS(.v16)],
|
||
dependencies: [
|
||
.package(url: "https://xuqinmin.com/xuqinmin12/XuqmGroup-iOSSDK", from: "0.2.0")
|
||
],
|
||
targets: [
|
||
.target(
|
||
name: "MyApp",
|
||
dependencies: [
|
||
.product(name: "XuqmSDK", package: "XuqmGroup-iOSSDK")
|
||
]
|
||
)
|
||
]
|
||
)
|
||
```
|
||
|
||
> 目前 iOS SDK 以单模块 `XuqmSDK` 发布,内部包含 Core、IM、Push、Update 子模块。
|
||
|
||
---
|
||
|
||
## 最低 iOS 版本
|
||
|
||
- iOS 16.0+
|
||
- macOS 13.0+(如需 Mac Catalyst)
|
||
- Xcode 16.0+
|
||
|
||
---
|
||
|
||
## 权限声明
|
||
|
||
根据业务需要,在 `Info.plist` 中添加以下权限:
|
||
|
||
### Camera(拍照/视频通话)
|
||
|
||
```xml
|
||
<key>NSCameraUsageDescription</key>
|
||
<string>需要访问相机以发送图片或进行视频通话</string>
|
||
```
|
||
|
||
### Photo Library(发送图片/视频)
|
||
|
||
```xml
|
||
<key>NSPhotoLibraryUsageDescription</key>
|
||
<string>需要访问相册以发送图片和视频</string>
|
||
```
|
||
|
||
### Microphone(语音消息/语音通话)
|
||
|
||
```xml
|
||
<key>NSMicrophoneUsageDescription</key>
|
||
<string>需要访问麦克风以发送语音消息或进行通话</string>
|
||
```
|
||
|
||
---
|
||
|
||
## 初始化
|
||
|
||
在 `AppDelegate` 或 `SceneDelegate` 中:
|
||
|
||
```swift
|
||
import XuqmSDK
|
||
|
||
XuqmSDK.shared.initialize(config: config)
|
||
```
|
||
|
||
---
|
||
|
||
## 下一步
|
||
|
||
- [iOS IM 接入 →](./im)
|
||
- [iOS Push 接入 →](./push)
|
||
- [iOS 版本更新 →](./update)
|
||
- [iOS 授权管理 →](./license)
|