Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from vinnyt/addCategoryPayload
Browse files Browse the repository at this point in the history
add payload category
  • Loading branch information
Matthijs Logemann authored Oct 17, 2016
2 parents 7e3a91a + a2dafad commit 0ba147f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/VaporAPNS/Payload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ open class Payload: JSONRepresentable {

/// The name of a sound file in the app bundle or in the Library/Sounds folder of the app’s data container. The sound in this file is played as an alert. If the sound file doesn’t exist or default is specified as the value, the default alert sound is played.
public var sound: String?

/// a category that is used by iOS 10+ notifications
public var category: String?

/// Silent push notification. This automatically ignores any other push message keys (title, body, ect.) and only the extra key-value pairs are added to the final payload
public var contentAvailable: Bool = false
Expand Down Expand Up @@ -105,7 +108,11 @@ open class Payload: JSONRepresentable {
if let sound = sound {
apsPayloadData["sound"] = sound
}


if let category = category {
apsPayloadData["category"] = category
}

}

payloadData["aps"] = try apsPayloadData.makeNode()
Expand Down

0 comments on commit 0ba147f

Please sign in to comment.