@jesushr0013/native-timer 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Jesushr0013NativeTimer.podspec +3 -14
- package/NativeTimerKit.podspec +3 -5
- package/Package.swift +16 -3
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/ios/{LiveActivitiesKit → Core}/NativeTimerManager.swift +0 -25
- package/ios/Core/WorkSessionTimerAttributes.swift +32 -0
- package/ios/{LiveActivitiesKit → LiveActivities}/NativeTimerWidget.swift +8 -2
- package/ios/Plugin/NativeTimerPlugin.swift +4 -0
- package/package.json +1 -1
|
@@ -11,23 +11,12 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.homepage = package['repository']['url'] rescue 'https://github.com/jesherram/native-timer'
|
|
12
12
|
s.author = package['author']
|
|
13
13
|
s.source = { :git => 'https://github.com/jesherram/native-timer.git', :tag => s.version.to_s }
|
|
14
|
-
s.source_files = 'ios/
|
|
15
|
-
s.public_header_files = 'ios/LiveActivitiesKit/*.h'
|
|
14
|
+
s.source_files = 'ios/Core/**/*.{swift,h,m,c,cc,mm,cpp}', 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
16
15
|
|
|
17
16
|
s.ios.deployment_target = '15.0'
|
|
18
17
|
s.dependency 'Capacitor'
|
|
19
18
|
s.swift_version = '5.1'
|
|
20
19
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
# y en iOS 16.x no existe como framework independiente
|
|
24
|
-
s.weak_frameworks = 'WidgetKit', 'SwiftUI', 'ActivityKit', 'SwiftUICore'
|
|
25
|
-
|
|
26
|
-
# Linker flags para asegurar weak linking de SwiftUICore
|
|
27
|
-
s.pod_target_xcconfig = {
|
|
28
|
-
'OTHER_LDFLAGS' => '$(inherited) -weak_framework SwiftUICore'
|
|
29
|
-
}
|
|
30
|
-
s.user_target_xcconfig = {
|
|
31
|
-
'OTHER_LDFLAGS' => '$(inherited) -weak_framework SwiftUICore'
|
|
32
|
-
}
|
|
20
|
+
# Solo ActivityKit como weak_framework - SwiftUI ya NO se linkea en este target
|
|
21
|
+
s.weak_frameworks = 'ActivityKit'
|
|
33
22
|
end
|
package/NativeTimerKit.podspec
CHANGED
|
@@ -6,15 +6,13 @@ Pod::Spec.new do |s|
|
|
|
6
6
|
s.homepage = 'https://github.com/jesherram/native-timer'
|
|
7
7
|
s.author = { 'Meycagesal' => 'info@meycagesal.com' }
|
|
8
8
|
s.source = { :git => 'https://github.com/jesherram/native-timer.git', :tag => s.version.to_s }
|
|
9
|
-
s.source_files = 'ios/
|
|
10
|
-
s.public_header_files = 'ios/LiveActivitiesKit/*.h'
|
|
9
|
+
s.source_files = 'ios/LiveActivities/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
11
10
|
|
|
12
11
|
s.ios.deployment_target = '15.0'
|
|
12
|
+
s.dependency 'Jesushr0013NativeTimer'
|
|
13
13
|
s.swift_version = '5.1'
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
# SwiftUICore es necesario como weak_framework porque Xcode 16+ lo separa de SwiftUI
|
|
17
|
-
# y en iOS 16.x no existe como framework independiente
|
|
15
|
+
# Live Activities requiere SwiftUI - weak linking para compatibilidad con iOS < 16.1
|
|
18
16
|
s.weak_frameworks = 'WidgetKit', 'SwiftUI', 'ActivityKit', 'SwiftUICore'
|
|
19
17
|
|
|
20
18
|
# Linker flags para asegurar weak linking de SwiftUICore
|
package/Package.swift
CHANGED
|
@@ -7,19 +7,32 @@ let package = Package(
|
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "Jesushr0013NativeTimer",
|
|
10
|
-
targets: ["Jesushr0013NativeTimer"])
|
|
10
|
+
targets: ["Jesushr0013NativeTimer"]),
|
|
11
|
+
.library(
|
|
12
|
+
name: "NativeTimerLiveActivities",
|
|
13
|
+
targets: ["NativeTimerLiveActivities"])
|
|
11
14
|
],
|
|
12
15
|
dependencies: [
|
|
13
16
|
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
17
|
],
|
|
15
18
|
targets: [
|
|
19
|
+
.target(
|
|
20
|
+
name: "NativeTimerCore",
|
|
21
|
+
dependencies: [],
|
|
22
|
+
path: "ios/Core"),
|
|
16
23
|
.target(
|
|
17
24
|
name: "Jesushr0013NativeTimer",
|
|
18
25
|
dependencies: [
|
|
26
|
+
"NativeTimerCore",
|
|
19
27
|
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
28
|
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
29
|
],
|
|
22
|
-
path: "ios",
|
|
23
|
-
|
|
30
|
+
path: "ios/Plugin"),
|
|
31
|
+
.target(
|
|
32
|
+
name: "NativeTimerLiveActivities",
|
|
33
|
+
dependencies: [
|
|
34
|
+
"NativeTimerCore"
|
|
35
|
+
],
|
|
36
|
+
path: "ios/LiveActivities")
|
|
24
37
|
]
|
|
25
38
|
)
|
|
File without changes
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
gradle.version=
|
|
1
|
+
#Thu Apr 16 07:13:06 CEST 2026
|
|
2
|
+
gradle.version=8.9
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,31 +6,6 @@ import UIKit
|
|
|
6
6
|
import ActivityKit
|
|
7
7
|
#endif
|
|
8
8
|
|
|
9
|
-
@available(iOS 16.2, *)
|
|
10
|
-
public struct WorkSessionTimerAttributes: ActivityAttributes {
|
|
11
|
-
public struct ContentState: Codable, Hashable {
|
|
12
|
-
public let title: String
|
|
13
|
-
public let elapsedTime: String
|
|
14
|
-
public let status: String
|
|
15
|
-
public let startTime: String
|
|
16
|
-
public let primaryColor: String
|
|
17
|
-
|
|
18
|
-
public init(title: String, elapsedTime: String, status: String, startTime: String, primaryColor: String = "#0045a5") {
|
|
19
|
-
self.title = title
|
|
20
|
-
self.elapsedTime = elapsedTime
|
|
21
|
-
self.status = status
|
|
22
|
-
self.startTime = startTime
|
|
23
|
-
self.primaryColor = primaryColor
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public let sessionName: String
|
|
28
|
-
|
|
29
|
-
public init(sessionName: String) {
|
|
30
|
-
self.sessionName = sessionName
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
9
|
public class NativeTimerManager {
|
|
35
10
|
private var startTime: Date?
|
|
36
11
|
private var timer: Timer?
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
#if canImport(ActivityKit)
|
|
4
|
+
import ActivityKit
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#if canImport(ActivityKit)
|
|
8
|
+
@available(iOS 16.1, *)
|
|
9
|
+
public struct WorkSessionTimerAttributes: ActivityAttributes {
|
|
10
|
+
public struct ContentState: Codable, Hashable {
|
|
11
|
+
public let title: String
|
|
12
|
+
public let elapsedTime: String
|
|
13
|
+
public let status: String
|
|
14
|
+
public let startTime: String
|
|
15
|
+
public let primaryColor: String
|
|
16
|
+
|
|
17
|
+
public init(title: String, elapsedTime: String, status: String, startTime: String, primaryColor: String = "#0045a5") {
|
|
18
|
+
self.title = title
|
|
19
|
+
self.elapsedTime = elapsedTime
|
|
20
|
+
self.status = status
|
|
21
|
+
self.startTime = startTime
|
|
22
|
+
self.primaryColor = primaryColor
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public let sessionName: String
|
|
27
|
+
|
|
28
|
+
public init(sessionName: String) {
|
|
29
|
+
self.sessionName = sessionName
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
#endif
|
|
@@ -3,7 +3,13 @@ import SwiftUI
|
|
|
3
3
|
import WidgetKit
|
|
4
4
|
import ActivityKit
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
#if canImport(NativeTimerCore)
|
|
7
|
+
import NativeTimerCore
|
|
8
|
+
#elseif canImport(MeycagesalNativeTimer)
|
|
9
|
+
import MeycagesalNativeTimer
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
@available(iOS 16.1, *)
|
|
7
13
|
public struct NativeTimerWidget: Widget {
|
|
8
14
|
public var body: some WidgetConfiguration {
|
|
9
15
|
ActivityConfiguration(for: WorkSessionTimerAttributes.self) { context in
|
|
@@ -467,7 +473,7 @@ extension Color {
|
|
|
467
473
|
}
|
|
468
474
|
}
|
|
469
475
|
|
|
470
|
-
@available(iOS 16.
|
|
476
|
+
@available(iOS 16.1, *)
|
|
471
477
|
public struct NativeTimerWidgetBundle: WidgetBundle {
|
|
472
478
|
public var body: some Widget {
|
|
473
479
|
NativeTimerWidget()
|