Skip to content

Commit 5bf5585

Browse files
author
Iwan Gerber
committed
fix(workmanager_apple): Correct SPM structure and product name for Flutter compatibility
- Move Package.swift to ios/workmanager_apple/ subdirectory (Flutter SPM requirement) - Rename product from 'workmanager_apple' to 'workmanager-apple' (Flutter naming convention) - Add missing UIKit import in Extensions.swift for UIBackgroundFetchResult - Move Sources, Resources, Assets to correct subdirectory This fixes Swift Package Manager integration with Flutter's SPM plugin system, which expects: 1. Package.swift at ios/<plugin_name>/Package.swift 2. Product names with hyphens (e.g., 'workmanager-apple' not 'workmanager_apple') Without these fixes, Flutter falls back to CocoaPods instead of using SPM.
1 parent 7f4f870 commit 5bf5585

15 files changed

+3
-2
lines changed

workmanager_apple/ios/Package.swift renamed to workmanager_apple/ios/workmanager_apple/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let package = Package(
1010
],
1111
products: [
1212
.library(
13-
name: "workmanager_apple",
13+
name: "workmanager-apple",
1414
targets: ["workmanager_apple"]
1515
)
1616
],
@@ -19,7 +19,7 @@ let package = Package(
1919
name: "workmanager_apple",
2020
path: "Sources/workmanager_apple",
2121
resources: [
22-
.process("../Resources")
22+
.process("../../Resources")
2323
]
2424
)
2525
]

workmanager_apple/ios/Sources/workmanager_apple/Extensions.swift renamed to workmanager_apple/ios/workmanager_apple/Sources/workmanager_apple/Extensions.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import Foundation
9+
import UIKit
910

1011
extension UIBackgroundFetchResult: CustomDebugStringConvertible {
1112
public var debugDescription: String {

0 commit comments

Comments
 (0)