Skip to content

Commit 4aee81d

Browse files
authored
Privatize APNSPushType (#206)
Privateize APNSPushType
1 parent 6433378 commit 4aee81d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Sources/APNS/APNSClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ extension APNSClient {
145145
var headers = self.defaultRequestHeaders
146146

147147
// Push type
148-
headers.add(name: "apns-push-type", value: request.pushType.configuration.rawValue)
148+
headers.add(name: "apns-push-type", value: request.pushType.description)
149149

150150
// APNS ID
151151
if let apnsID = request.apnsID {

Sources/APNSCore/APNSPushType.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
/// A struct which represents the different supported APNs push types.
16-
public struct APNSPushType: Hashable, Sendable {
17-
public enum Configuration: String, Hashable, Sendable {
16+
public struct APNSPushType: Hashable, Sendable, CustomStringConvertible {
17+
18+
internal enum Configuration: String, Hashable, Sendable {
1819
case alert
1920
case background
2021
case location
@@ -24,9 +25,13 @@ public struct APNSPushType: Hashable, Sendable {
2425
case mdm
2526
case liveactivity
2627
}
28+
29+
public var description: String {
30+
configuration.rawValue
31+
}
2732

2833
/// The underlying raw value that is send to APNs.
29-
public var configuration: Configuration
34+
internal var configuration: Configuration
3035

3136
/// Use the alert push type for notifications that trigger a user interaction—for example, an alert, badge, or sound.
3237
///

0 commit comments

Comments
 (0)