-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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]>
- Loading branch information
1 parent
5833dc8
commit 2f5215d
Showing
26 changed files
with
125 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,12 @@ Flutter plugin for displaying local notifications. | |
DESC | ||
s.homepage = 'https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications' | ||
s.license = { :type => 'BSD', :file => '../LICENSE' } | ||
s.author = { 'Michael Bui' => '[email protected]' } | ||
s.author = { 'Michael Bui' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.public_header_files = 'Classes/**/*.h' | ||
s.source_files = 'flutter_local_notifications/Sources/flutter_local_notifications/**/*.{h,m}' | ||
s.public_header_files = 'flutter_local_notifications/Sources/flutter_local_notifications/include/**/*.h' | ||
s.dependency 'Flutter' | ||
s.resource_bundles = {'flutter_local_notifications_privacy' => ['Resources/PrivacyInfo.xcprivacy']} | ||
s.resource_bundles = {'flutter_local_notifications_privacy' => ['flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy']} | ||
s.ios.deployment_target = '11.0' | ||
end | ||
|
27 changes: 27 additions & 0 deletions
27
flutter_local_notifications/ios/flutter_local_notifications/Package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "flutter_local_notifications", | ||
platforms: [ | ||
.iOS("11.0") | ||
], | ||
products: [ | ||
.library(name: "flutter-local-notifications", targets: ["flutter_local_notifications"]) | ||
], | ||
dependencies: [], | ||
targets: [ | ||
.target( | ||
name: "flutter_local_notifications", | ||
dependencies: [], | ||
resources: [ | ||
.process("PrivacyInfo.xcprivacy") | ||
], | ||
cSettings: [ | ||
.headerSearchPath("include/flutter_local_notifications") | ||
] | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...Classes/FlutterLocalNotificationsPlugin.m → ...cations/FlutterLocalNotificationsPlugin.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,13 @@ Flutter plugin for displaying local notifications. | |
DESC | ||
s.homepage = 'https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications' | ||
s.license = { :type => 'BSD', :file => '../LICENSE' } | ||
s.author = { 'Michael Bui' => '[email protected]' } | ||
s.author = { 'Michael Bui' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.source_files = 'flutter_local_notifications/Sources/flutter_local_notifications/**/*.swift' | ||
s.dependency 'FlutterMacOS' | ||
|
||
s.platform = :osx, '10.14' | ||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } | ||
s.resource_bundles = {'flutter_local_notifications_privacy' => ['Resources/PrivacyInfo.xcprivacy']} | ||
s.resource_bundles = {'flutter_local_notifications_privacy' => ['flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy']} | ||
s.swift_version = '5.0' | ||
end |
27 changes: 27 additions & 0 deletions
27
flutter_local_notifications/macos/flutter_local_notifications/Package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "flutter_local_notifications", | ||
platforms: [ | ||
.macOS("10.14") | ||
], | ||
products: [ | ||
.library(name: "flutter-local-notifications", targets: ["flutter_local_notifications"]) | ||
], | ||
dependencies: [], | ||
targets: [ | ||
.target( | ||
name: "flutter_local_notifications", | ||
dependencies: [], | ||
resources: [ | ||
.process("PrivacyInfo.xcprivacy") | ||
], | ||
cSettings: [ | ||
.headerSearchPath("include/flutter_local_notifications") | ||
] | ||
) | ||
] | ||
) |
29 changes: 29 additions & 0 deletions
29
...ns/macos/flutter_local_notifications/Sources/flutter_local_notifications/Converters.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import UserNotifications | ||
|
||
public class Converters { | ||
public static func parseNotificationCategoryOptions(_ options: [Any]?) -> UNNotificationCategoryOptions { | ||
var result: UInt = 0 | ||
|
||
for option in options ?? [] { | ||
guard let option = option as? NSNumber else { | ||
continue | ||
} | ||
result |= option.uintValue | ||
} | ||
|
||
return UNNotificationCategoryOptions(rawValue: result) | ||
} | ||
|
||
public static func parseNotificationActionOptions(_ options: [Any]?) -> UNNotificationActionOptions { | ||
var result: UInt = 0 | ||
|
||
for option in options ?? [] { | ||
guard let option = option as? NSNumber else { | ||
continue | ||
} | ||
result |= option.uintValue | ||
} | ||
|
||
return UNNotificationActionOptions(rawValue: result) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters