Skip to content

Commit 7b8f631

Browse files
weiruiyangclaude
andcommitted
feat: iOS 插件支持 Swift Package Manager(google 版)
复刻主版 dev-3.x 分支 ae3749c 的 SPM + CocoaPods 双轨改造: - 源码从 ios/Classes/ 迁移到 ios/jpush_google_flutter/Sources/jpush_google_flutter/ (SPM 标准结构,公开头文件放 include/jpush_google_flutter/),源码内容零修改 - 新增 ios/jpush_google_flutter/Package.swift:依赖 github.com/jpush/jpush-sdk 6.2.0 与 jcore-sdk >= 5.5.0(与 podspec 版本对齐);平台声明 iOS 13 仅对 SPM 路径生效, podspec 的 deployment_target 8.0 保持不变 - podspec 的 source_files/public_header_files 同步指向新路径,CocoaPods 老用户不受影响 - 版本号 3.0.6,更新 CHANGELOG 与 README 的 SPM 集成说明 已验证(Xcode 27 / Flutter 3.44.6,device 免签构建): - SPM 路径:Runner.app 链接 JPUSHService 符号 176 个,SourcePackages 正确拉取两个 SDK - CocoaPods 路径:--no-enable-swift-package-manager 下按新路径编译通过 注意:本地 example 走 SPM 验证需在名为 jpush_google_flutter 的目录副本中构建, checkout 目录名与包名不一致会触发 flutter 工具链已知缺陷 flutter/flutter#186881。 Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 8e36e09 commit 7b8f631

8 files changed

Lines changed: 45 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.6 (2026-08-05)
2+
3+
- iOS 插件支持 Swift Package Manager 集成方式(需 Flutter 3.24+,CocoaPods 集成不受影响)。
4+
15
## 3.0.5
26
android升级到jpush 6.2.0
37
ios升级到jpush 6.2.0 jcore 5.5.0

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ dependencies:
1616
1717
// pub 集成
1818
dependencies:
19-
jpush_google_flutter: 3.0.5
19+
jpush_google_flutter: 3.0.6
2020
```
2121

22+
> iOS 插件已支持 Swift Package Manager 集成方式(需 Flutter 3.24+ 并启用 SPM),CocoaPods 集成不受影响、无需任何调整。
23+
2224
### 配置
2325

2426
##### Android:

‎ios/jpush_google_flutter.podspec‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ A new flutter plugin project.
1212
s.license = { :file => '../LICENSE' }
1313
s.author = { 'xudong.rao' => '[email protected]' }
1414
s.source = { :path => '.' }
15-
s.source_files = 'Classes/**/*'
16-
s.public_header_files = 'Classes/**/*.h'
15+
s.source_files = 'jpush_google_flutter/Sources/jpush_google_flutter/**/*.{h,m}'
16+
s.public_header_files = 'jpush_google_flutter/Sources/jpush_google_flutter/include/**/*.h'
1717
s.dependency 'Flutter'
1818
s.dependency 'JCore','>= 5.5.0'
1919
s.dependency 'JPush','6.2.0'
20-
20+
2121
s.ios.deployment_target = '8.0'
2222
s.static_framework = true
2323
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.build/
2+
.swiftpm/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "jpush_google_flutter",
8+
platforms: [
9+
.iOS("13.0")
10+
],
11+
products: [
12+
.library(name: "jpush-google-flutter", targets: ["jpush_google_flutter"])
13+
],
14+
dependencies: [
15+
.package(name: "FlutterFramework", path: "../FlutterFramework"),
16+
.package(url: "https://github.com/jpush/jcore-sdk.git", from: "5.5.0"),
17+
.package(url: "https://github.com/jpush/jpush-sdk.git", exact: "6.2.0")
18+
],
19+
targets: [
20+
.target(
21+
name: "jpush_google_flutter",
22+
dependencies: [
23+
.product(name: "FlutterFramework", package: "FlutterFramework"),
24+
.product(name: "JCore", package: "jcore-sdk"),
25+
.product(name: "JPush", package: "jpush-sdk")
26+
],
27+
cSettings: [
28+
.headerSearchPath("include/jpush_google_flutter")
29+
]
30+
)
31+
]
32+
)

ios/Classes/JPushPlugin.m renamed to ios/jpush_google_flutter/Sources/jpush_google_flutter/JPushPlugin.m

File renamed without changes.

ios/Classes/JPushPlugin.h renamed to ios/jpush_google_flutter/Sources/jpush_google_flutter/include/jpush_google_flutter/JPushPlugin.h

File renamed without changes.

‎pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: jpush_google_flutter
22
description: JIGUANG officially supported JPush Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)(https://www.jiguang.cn).
3-
version: 3.0.5
3+
version: 3.0.6
44
# author: xudong.rao <[email protected]>
55
homepage: https://www.jiguang.cn
66

0 commit comments

Comments
 (0)