Skip to content

Commit

Permalink
Privateize APNSPushType
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebrowning committed Aug 20, 2024
1 parent 6433378 commit 2df3943
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/APNS/APNSClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extension APNSClient {
var headers = self.defaultRequestHeaders

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

// APNS ID
if let apnsID = request.apnsID {
Expand Down
11 changes: 8 additions & 3 deletions Sources/APNSCore/APNSPushType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
//===----------------------------------------------------------------------===//

/// A struct which represents the different supported APNs push types.
public struct APNSPushType: Hashable, Sendable {
public enum Configuration: String, Hashable, Sendable {
public struct APNSPushType: Hashable, Sendable, CustomStringConvertible {

internal enum Configuration: String, Hashable, Sendable {
case alert
case background
case location
Expand All @@ -24,9 +25,13 @@ public struct APNSPushType: Hashable, Sendable {
case mdm
case liveactivity
}

public var description: String {
configuration.rawValue
}

/// The underlying raw value that is send to APNs.
public var configuration: Configuration
internal var configuration: Configuration

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

0 comments on commit 2df3943

Please sign in to comment.