Skip to content

Commit 2f5215d

Browse files
MaikuBAnkaAnka
authored
[flutter_local_notifications] added Swift Package Manager support (#2500)
* added SPM support * moved PrivacyInfo.xcprivacy * updated Converters to avoid mixed language source file issue for SPM * Swift Format * fixed Swift Converters class * change DarwinNotificationActionOption and DarwinNotificationCategoryOption to be enhanced enums * Swift Format --------- Co-authored-by: Anka <[email protected]> Co-authored-by: Anka <[email protected]>
1 parent 5833dc8 commit 2f5215d

File tree

26 files changed

+125
-48
lines changed

26 files changed

+125
-48
lines changed

flutter_local_notifications/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [19.0.0-dev.3]
2+
3+
* [iOS][macOS] **Breaking changes** the `DarwinNotificationActionOption` and `DarwinNotificationCategoryOption` are now enhanced enums with values accessible through the `value` property that are exactly the same as their native representations. Previously a bitwise left shift operation was applied to the index value
4+
* [iOS][macOS] added Swift Package Manager support
5+
16
## [19.0.0-dev.2]
27

38
* [Windows] Fixed an issue that happens with MSIX app builds. Thanks to PR from [Levi Lesches](https://github.com/Levi-Lesches)

flutter_local_notifications/ios/Assets/.gitkeep

Whitespace-only changes.

flutter_local_notifications/ios/Classes/Converters.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

flutter_local_notifications/ios/Classes/Converters.m

Lines changed: 0 additions & 1 deletion
This file was deleted.

flutter_local_notifications/ios/flutter_local_notifications.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Flutter plugin for displaying local notifications.
1010
DESC
1111
s.homepage = 'https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications'
1212
s.license = { :type => 'BSD', :file => '../LICENSE' }
13-
s.author = { 'Michael Bui' => '[email protected]' }
13+
s.author = { 'Michael Bui' => '[email protected]' }
1414
s.source = { :path => '.' }
15-
s.source_files = 'Classes/**/*'
16-
s.public_header_files = 'Classes/**/*.h'
15+
s.source_files = 'flutter_local_notifications/Sources/flutter_local_notifications/**/*.{h,m}'
16+
s.public_header_files = 'flutter_local_notifications/Sources/flutter_local_notifications/include/**/*.h'
1717
s.dependency 'Flutter'
18-
s.resource_bundles = {'flutter_local_notifications_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
18+
s.resource_bundles = {'flutter_local_notifications_privacy' => ['flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy']}
1919
s.ios.deployment_target = '11.0'
2020
end
2121

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: "flutter_local_notifications",
8+
platforms: [
9+
.iOS("11.0")
10+
],
11+
products: [
12+
.library(name: "flutter-local-notifications", targets: ["flutter_local_notifications"])
13+
],
14+
dependencies: [],
15+
targets: [
16+
.target(
17+
name: "flutter_local_notifications",
18+
dependencies: [],
19+
resources: [
20+
.process("PrivacyInfo.xcprivacy")
21+
],
22+
cSettings: [
23+
.headerSearchPath("include/flutter_local_notifications")
24+
]
25+
)
26+
]
27+
)

flutter_local_notifications/ios/Classes/ActionEventSink.m renamed to flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/ActionEventSink.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Sebastian Roth on 11/1/20.
66
//
77

8-
#import "ActionEventSink.h"
8+
#import "./include/flutter_local_notifications/ActionEventSink.h"
99

1010
@interface ActionEventSink () {
1111
NSMutableArray<NSDictionary *> *cache;

flutter_local_notifications/ios/Classes/FlutterEngineManager.m renamed to flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/FlutterEngineManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
#import <Flutter/Flutter.h>
1111

12-
#import "ActionEventSink.h"
13-
#import "FlutterEngineManager.h"
12+
#import "./include/flutter_local_notifications/ActionEventSink.h"
13+
#import "./include/flutter_local_notifications/FlutterEngineManager.h"
1414

1515
NS_ASSUME_NONNULL_BEGIN
1616

flutter_local_notifications/ios/Classes/FlutterLocalNotificationsPlugin.m renamed to flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/FlutterLocalNotificationsPlugin.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#import "FlutterLocalNotificationsPlugin.h"
2-
#import "ActionEventSink.h"
3-
#import "Converters.h"
4-
#import "FlutterEngineManager.h"
1+
#import "./include/flutter_local_notifications/FlutterLocalNotificationsPlugin.h"
2+
#import "./include/flutter_local_notifications/ActionEventSink.h"
3+
#import "./include/flutter_local_notifications/Converters.h"
4+
#import "./include/flutter_local_notifications/FlutterEngineManager.h"
55

66
@implementation FlutterLocalNotificationsPlugin {
77
FlutterMethodChannel *_channel;

0 commit comments

Comments
 (0)